Extension:TocTree

From mediawiki.org
This page is a translated version of the page Extension:TocTree and the translation is 24% complete.
MediaWiki 拡張機能マニュアル
TocTree
リリースの状態: 安定
実装 ユーザー インターフェイス
説明 Allows for expansion and collapsing of the table of contents
作者 Roland Unger, Matthias Mullie
最新バージョン 1.12.0
MediaWiki >= 1.42
ライセンス GNU 一般公衆利用許諾書 2.0 以降
ダウンロード
Quarterly downloads 14 (Ranked 130th)
translatewiki.net で翻訳を利用できる場合は、TocTree 拡張機能の翻訳にご協力ください
問題点 未解決のタスク · バグを報告

The TocTree extension allows for initial expansion and collapsing of the table of contents.

インストール

  • ダウンロードして、ファイルをextensions/フォルダー内のTocTreeという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/TocTree
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'TocTree' );
    
  • Yes 完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。

カスタマイズ

The PHP script will add two new options to the user preferences. They were added to the Misc section:

  • Floated table of contents
  • Expand table of contents

Defaults are collapsed but not floated tocs. You can overwrite the default values by setting true in your LocalSettings.php file:

$wgDefaultUserOptions['toc-floated'] = false;
$wgDefaultUserOptions['toc-expand'] = false;

Prevention of TOC floating

The author has the opportunity to prevent floating of the TOC set by the user(s) by using a div tag with the style class noFloat enclosing the TOC.

<div class="noFloat">__TOC__</div>

既知の問題点

There are the well-known problems of floated boxes like:

  • Missing list bullets
  • Design problems of narrow TOCs and positioning problems with text and wide right-floated boxes.

Additional:

  • Bidi support (right-to-left writing direction) implemented but not yet tested (for instance needed for Hebrew and Arabic).
  • Support of only the MonoBook and Vector skins.