Extension:EasyTimeline/インストール

From mediawiki.org
This page is a translated version of the page Extension:EasyTimeline/installation and the translation is 83% complete.

この節では、他のMediaWikiインストールでEasyTimeline を有効にする方法に関する問題を扱います。

EasyTimelineはMediaWikiソフトウェアの拡張機能です。 しかし、あなたはそれを有効化するためにいくつかのことをする必要があります。

Linux 以外のプラットフォームで MediaWiki を実行すると、次のことが適用されないか、不完全である可能性があります。

Ploticus のダウンロード

EasyTimelineは、オープンソースプログラムPloticusを使用していますが、MediaWikiのインストールには含まれていません。 ご使用のOSに適したバージョンをダウンロードしてください。 http://ploticus.sourceforge.net/doc/download.html

Or, if you are on Ubuntu with shell access, you can simply do

$ sudo apt install ploticus

EasyTimeline expects the Ploticus executable to be located at /usr/bin/ploticus, if it is not just make sure it's executable and put the appropriate location in $wgTimelinePloticusCommand described below.

PHP/PERLスクリプトのダウンロード

EasyTimeline.plはperlで書かれた実際のプラグインです。

Timeline.phpはMediaWikiのPHPラッパーで、適切な引数を指定してperlスクリプトを呼び出し、生成されたイメージとイメージマップ(該当する場合)をHTML出力に送ります。

Special:ExtensionDistributor/Timelineからダウンロードしてください

またはシェルへのアクセス権がある場合は、拡張機能ディレクトリに移動して、次のように入力します。

git clone -b REL1_28 https://gerrit.wikimedia.org/r/mediawiki/extensions/timeline.git

Do not use the EasyTimeline.pl script, or its compiled version, from the authors support page. These are meant for offline usage (= outside WikiMedia).

フォントのインストール

EasyTimelineは既定で、FreeSans.ttfというフォントを使用します。これはGNU FreeFontからダウンロードできます。

また、シェルアクセス権を持つUbuntu上にいる場合は、単に

$ sudo apt install fonts-freefont-ttf

EasyTimelineがFreeSans.ttfを見つけられるように、下記のGDFONTPATHを設定します。

MediaWikiの設定

拡張機能を読み込む

LocalSettings.php ファイルに以下を追加してください:

wfLoadExtension( "timeline" ); // EasyTimeline拡張機能を追加する

Ploticus

たとえばRHEL/CentOSでは、/usr/bin/plはploticusの実行ファイルです。 システムのploticusの場所がextensions/timeline/extension.jsonの上部に記載されているデフォルトと一致しない場合は、パスを明示的に設定する必要があります。

Add the following to you LocalSettings.php file:

$wgTimelinePloticusCommand = "/usr/bin/pl"; // alternate location of ploticus, depending on OS

別の場所へのシンボリックリンクを作成することもできます。

ploticusとperlの拡張機能の既定の設定:
$wgTimelinePloticusCommand = "/usr/bin/ploticus";
$wgTimelinePerlCommand = "/usr/bin/perl";

フォント

LocalSettings.php ファイルに以下を追加して、EasyTimelineがフォントを見つけられるようにしてください:

$wgTimelineFontDirectory = "/usr/share/fonts/truetype/freefont"; // Directory containing FreeSans.ttf.

FreeSans.ttfが利用できない場合は、代わりに次のように設定します。

$wgTimelineFontFile = 'ascii'; // Use the internal Ploticus font

画像ディレクトリ

タイムライン画像用のディレクトリを作成し、Webサーバのユーザーが読み書きできるようにします。 たとえば、Webサーバーのユーザーが「www-data」の場合、次のようになります。

$ cd (ウィキのルートディレクトリ)
$ mkdir images/timeline
$ chown www-data images/timeline

既知の問題点

Command Variables are Non-Transclusion

This problem occurs when an editor attempts to add certain words inside of the timeline which may be commands under document. One such example word instance would be for the word construction; when used in a timeline as a dated entry, an error type occurs, rendering the word construction as a command and not a clickable link.

チャートがクリック不可

このバグはPloticus 2.32で解決されました

それでも問題が解決しない場合は、簡単にEasyTimeline.plを編集して次のようにすることができます。

   $MapPNG = $true ; # switched when link or hint found

since it doesn't seem to apply when wikistyled links are just used on text tags and it can be annoying to figure that out.

Windows only: Timeline error: Executable not found. Command line was:

次のようなエラーが発生した場合

Timeline error: Executable not found. Command line was:
"C:/Perl/bin/perl.exe" "C:/Apache2/htdocs/wiki/extensions/timeline/EasyTimeline.pl"
-i "C:/Apache2/htdocs/wiki/images/timeline/bebc64ea32049f9fe1f251640849a318"
-m -P "C:/pl232win32/bin/pl.exe"
-T "C:/Apache2/htdocs/wiki/images/tmp" -A "/wiki/$1"

PHPファイル(通常はTimeline.phpまたはEasyTimeline.php)に行き、

 $ret = `{$cmdline}`;

を以下のように変更してください:

 $ret = `"{$cmdline}"`;

また、拡張機能のディレクトリ名を変更した可能性があります。これにより、上記の修正でも同じエラーが発生します。 LocalSettings.phpでtimelineFileを次のように設定します。

 $wgTimelineTimelineFile = "$IP\\extensions\\EasyTimeline\\EasyTimeline.pl";

Windowsのみ: perlへのパスを設定する

MediaWikiのインストールがWindowsで実行されている場合は、Timeline.phpを更新する必要があります。 $wgTimelinePerlCommandをperl.exeのパスに設定します。 既定では/usr/bin/perlですが、これはWindows用に変更する必要があります。

文章が表示されない

EasyTimeline には Unicode サポートのためのクイック修正が含まれています。 これにはフリーフォント FreeSans.ttfが必要です。 おそらくPloticusが見えるディレクトリにそのフォントが存在しないでしょう。 それがあなたのシステム上のどこにあるのかを調べるかもしれません: Ploticus docs onlineを見てください。

If you want a different font with reasonable code point coverage, try DejaVu, either Sans Condensed or Sans Extra-Light depending on your preferences.

GDFONTPATHの微調整

ttf-freefontをインストールしたUbuntuシステムでは、Timeline.phpを次のように変更すると、PloticusがFreeSans.ttfでテキストをレンダリングするためにGDFONTPATHを設定します。

$cmdline = 'GDFONTPATH=/usr/share/fonts/truetype/freefont' . ' ' .
           wfEscapeShellArg( $wgTimelinePerlCommand, $IP . "/extensions/timeline/EasyTimeline.pl" ) .
  " -i " . wfEscapeShellArg( $fname ) . " -m -P " . wfEscapeShellArg( $wgTimelinePloticusCommand ) .
  " -T " . wfEscapeShellArg( $wgTmpDirectory ) . " -A " . wfEscapeShellArg( $wgArticlePath );

または単に「putenv("GDFONTPATH=/usr/share/fonts/truetype/freefont");」をLocalSettings.phpに追加してください。