Table of Contents
Compatible with DokuWiki
- 2022-07-31 "Igor" unknown
- 2020-07-29 "Hogfather" yes
- 2018-04-22 "Greebo" yes
- 2017-02-19 "Frusterick Manners" yes
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 automatically load the TOC for the currently displayed page.
Similar to inlinetoc, nstoc, toc, tocafterheadline
Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.
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.
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.
Manual TOC Selection
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
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.
Whichever of the above two syntax methods you use, the basic display and functioning is the same for both.
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.
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.
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.
There is one configuration option:
|Suppress 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.
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:
- fixes version date (2017-12-07 15:05)
- removed testing file get_meta.php (2017-01-09 03:20)
- added Namespace Root link to mousoeover titles (2016-12-26 15:47)
- mouse over title for text input box (2016-12-26 15:21)
- added mouse over titles to UP arrow and added UP for Root NS (2016-12-26 02:20)
- added mouseover title to namespace root link (2016-12-25 22:11)
- restored standard open/closed carrows (2016-12-25 19:22)
- probable solution to toggle problem: .off() prevents bubbling (2016-12-24 03:25)
- removed some left-overs from toggle feature (2016-12-23 23:01)
- updated info (2016-12-23 22:48)
- removed toggle feature (2016-12-23 22:46)
- replaced 'Up' with up arrow (2016-12-23 05:29)
For a complete history of the Changes to the plugin, see: github commits