DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:tocselect

tocselect Plugin

Compatible with DokuWiki

  • 2024-02-06 "Kaos" unknown
  • 2023-04-04 "Jack Jackrum" unknown
  • 2022-07-31 "Igor" unknown
  • 2020-07-29 "Hogfather" yes

plugin Create table of contents for any wiki page in sidebar or in a wiki page. The TOC can be set using a textbox selection, the wiki:id for which can be changed as needed either manually or from its index of pages and namespaces, or it can be set to automatica

Last updated on
2017-12-07
Provides
Syntax, Action
Repository
Source

Similar to inlinetoc, nstoc, toc, tocafterheadline

Tagged with index, sitemap, toc

Installation

Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.

Purpose

This plugin inserts a TOC and namespace index into the sidebar or into the current page. Depending on the syntax, the TOC may be for either a user-selected page or for the current page when configured to be automatically updated. When inserted into a wiki page, it replaces the Dokuwiki TOC. There is a Configuration Option which suppresses Dokuwiki's TOC. This is useful when the tocselect listing is placed in the sidebar and is set to be automatically updated to the current page.

You can install only one tocselect listing at a time, that is it cannot be inserted simultaneously both into the sidebar and into the adjacent page. If this occurs, the sidebar takes precedence and the TOC/Index does not print to the page.

A toselect listing can be placed vertically anywhere on the page, not just at the top. To change the horizontal alignment, you would have to make the relevant changes to .dokuwiki .tocsel_right in the plugin directory: tocselect/style.css.

Syntax

Manual TOC Selection

  ~~SELECTTOC~~

This format will create a textbox with a button. You then enter a wiki id into the text box and click the button. The table of contents for the selected page will load beneath the textbox. The list items in the TOC are clickable. If the TOC is in a sidebar, the tocselect TOC will retain its settings between page changes.

Auto-Selection of Current Page ID

 ~~SELECTTOC>curID~~

This format will automatically select and open the TOC for the currently displayed page. In addition it retains the selection box illustrated in the previous form, making it possible to enter an alternate page ID. But when the page reloads, it will switch back to the current ID.

'tocselect' Listings

Whichever of the above two syntax methods you use, the basic display and functioning is the same for both.

Index Listing

The Index lists both pages and namespaces. The items in bold are namespaces; when clicked they will moved down the namespace hierarchy into their own namespaces. The colon-asterisk markup :* indicates a namespace. Page names (green) are modeled on Dokuwiki internal links and when clicked will load the Table of Contents for the selected page.

The Namespace Root link, when clicked, displays the root namespace directory and all of its files and namespaces. Clicking the Up Arrow moves you up to the previous directory.

As a convenience, when the mouse moves over the UP arrow, a tooltip displays the name of the previous namespace. A tooltip also appears when the mouse goes over the Select ID input box; this is particularly convenient in the case of long names.

Table of Contents Listings

The title of the listing depends on where you are at. If it is a namespace listing, then the title is Index, as in the above illustrations. If it is a table of contents for one of the pages, then it will be labeled Table of Contents. The items in the Table of Contents are links to the headings in the currently selected page.

Styling

The height and width of the TOC/Index can be reset in tocselect/style.css. The current settings are suited to the default dokuwiki template's sidebar.

Configuration

There is one configuration option:

notocSuppress Dokuwiki's in-page TOCs default: false

When set to true, Dokuwiki's own TOCs are turned off. This configuration option is convenient if you are going to install the tocselect listings in the sidebar, preventing duplication. When the tocselect TOC is installed in a page, the Dokuwiki TOC is automatically suppressed.

Non-Roman Alphabets

There is a version which supports Dokuwiki's urlencoding for names containing non-Roman characters, either all or in part. It does not support Dokuwiki's Safe Filename encoding, though that is a TODO.

Download and install either manually or using the Manual tab of the Extension Manager:

Changes

plugin/tocselect.txt · Last modified: 2023-10-30 22:35 by Klap-in

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki