Jump to content

확장 기능:TocTree

From mediawiki.org
This page is a translated version of the page Extension:TocTree and the translation is 6% complete.
미디어위키 확장 기능 설명서
TocTree
출시 상태: 안정
구현 사용자 인터페이스
설명 Allows for expansion and collapsing of the table of contents
만든 이 Roland Unger, Matthias Mullie
최신 버전 1.12.0
MediaWiki >= 1.47.0
Licence GNU General Public License 2.0 or later
다운로드
TocTree 확장 기능 번역 (translatewiki.net에서 가능한 경우)
이슈 미해결 작업 · 버그 보고

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

Installation

  • 파일을 다운로드하고 TocTree 폴더를 extensions/ 디렉토리에 넣어 주세요.
    개발자와 코딩 기여자는 Git을 이용해 확장기능을 다운받는 것이 좋습니다.
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/TocTree
    
  • 아래의 코드를 LocalSettings.php 코드의 마지막에 추가합니다.
    wfLoadExtension( 'TocTree' );
    
  • Yes 완료 – 위키의 ‘Special:Version’에 이동해서, 확장기능이 올바르게 설치된 것을 확인합니다.

Customization

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>

Known problems

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.