plugin:toctweak
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:toctweak [2015-05-19 20:37] – [Discussion] fnadde42 | plugin:toctweak [2023-12-04 21:10] (current) – [Control macro for DokuWiki built-in TOC] Fix typo 177.208.41.57 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
---- plugin ---- | ---- plugin ---- | ||
- | description: | + | description: |
author | author | ||
email : sahara.satoshi@gmail.com | email : sahara.satoshi@gmail.com | ||
type : syntax, action | type : syntax, action | ||
- | lastupdate : 2015-02-28 | + | lastupdate : 2018-01-08 |
- | compatible : Binky, Ponder Stibbons, Hrun | + | compatible : Hrun, Detritus, Elenor of Tsort, Frusterick Manners, Greebo, Hogfather, Igor |
depends | depends | ||
conflicts | conflicts | ||
Line 13: | Line 13: | ||
tags : toc | tags : toc | ||
- | downloadurl: | + | downloadurl: |
bugtracker : https:// | bugtracker : https:// | ||
sourcerepo : https:// | sourcerepo : https:// | ||
Line 23: | Line 23: | ||
===== Installation ===== | ===== Installation ===== | ||
- | Install | + | Search and install |
- | ===== Examples/ | + | Current development work in progress under Version 2.x series. |
+ | In case you want to get older plugin version, please visit: | ||
+ | * [[https:// | ||
+ | |||
+ | ===== Feature ===== | ||
+ | |||
+ | Implement different mechanism for table of contents (TOC). TocTweak plugin (version 2) will store all headlines in the page to metadata (even if some of them are not shown in toc box), and provide METATOC syntax variants that render tailored %%TOC%% block inside the page content using metadata. | ||
+ | |||
+ | |||
+ | ===== Examples/ | ||
+ | |||
+ | ==== Control macro for DokuWiki built-in TOC ==== | ||
+ | |||
+ | < | ||
+ | ~~CLOSETOC~~ | ||
+ | ~~TOC 2-3~~ Headlines within level 2 to 3 will appear in the TOC box | ||
+ | ~~NOTOC 2-3~~ No TOC box on the page, but set headline level parameter | ||
+ | ~~TOC 2-3 wide~~ | ||
+ | ~~TOC_HERE 2-3~~ | ||
+ | </ | ||
+ | |||
+ | == Note == | ||
+ | * Headlines level parameter must be "// | ||
+ | * The built-in toc box (or %%auto-TOC%%) should be one per page, therefore more than once "'' | ||
+ | |||
+ | ==== METATOC: Another method to show TOC (in different looks/ | ||
+ | |||
+ | {{ https:// | ||
+ | |||
+ | TocTweak plugin provides following syntax to render toc block in pages where it is located in source. These are implemented as variants of basic **METATOC** syntax, and can be used multiple times in a page. | ||
+ | |||
+ | - '' | ||
+ | - '' | ||
+ | - '' | ||
+ | - '' | ||
+ | |||
+ | METATOC syntax family can render headline list of other page. It is also possible to specify starting section title, headline level range, and %%TOC%% box title. | ||
+ | |||
+ | {{METATOC 3-3 >: | ||
+ | {{METATOC 3-3 >: | ||
+ | {{METATOC 2-3 ># | ||
+ | {{METATOC 2-3}} | ||
+ | |||
+ | == Note == | ||
+ | * The section title may contains spaces, therefore headline level parameter must be given before " | ||
+ | * set %%TOC%% title blank (given after " | ||
+ | * SIDETOC ignores //n-m// parameter, which will be retrieved from metadata of current page. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Examples/ | ||
==== 1. Set the TOC initially closed ==== | ==== 1. Set the TOC initially closed ==== | ||
+ | |||
~~CLOSETOC~~ | ~~CLOSETOC~~ | ||
Line 33: | Line 84: | ||
==== 2. Set top and max level of headings displayed in the TOC==== | ==== 2. Set top and max level of headings displayed in the TOC==== | ||
- | | + | |
+ | | ||
* Control the content of the TOC for the page. There are two numeric parameters: [[: | * Control the content of the TOC for the page. There are two numeric parameters: [[: | ||
* Above example will exclude the page title (i.e. the first level 1 heading) from the TOC. Headings from level 2 to 4 included in the automatically generated Table of Contents. | * Above example will exclude the page title (i.e. the first level 1 heading) from the TOC. Headings from level 2 to 4 included in the automatically generated Table of Contents. | ||
* You can tweak either top or max level of headings, for example:< | * You can tweak either top or max level of headings, for example:< | ||
- | ~~TOC:2~~ | + | ~~TOC 2~~ |
- | ~~TOC:-3~~ | + | ~~TOC -3~~ |
</ | </ | ||
==== 3. move TOC position ==== | ==== 3. move TOC position ==== | ||
+ | |||
{{TOC}} | {{TOC}} | ||
* Move/slide the TOC box placed at top right corner to anywhere in the page. Exactly, the TOC position is changeable only vertically in the page because the macro '' | * Move/slide the TOC box placed at top right corner to anywhere in the page. Exactly, the TOC position is changeable only vertically in the page because the macro '' | ||
- | {{TOC:wide}} | + | {{TOC wide}} |
* You can add css class to the TOC div box identifed with '' | * You can add css class to the TOC div box identifed with '' | ||
- | {{TOC:2-3 wide}} | + | {{TOC 2-3 wide}} |
* You may give both class and heading levels parameter in this syntax. | * You may give both class and heading levels parameter in this syntax. | ||
Line 57: | Line 110: | ||
==== 4. inline TOC ==== | ==== 4. inline TOC ==== | ||
- | {{INLINETOC:width18 3-4}} | + | {{INLINETOC width18 3-4}} |
* This syntax renders TOC of a page inside the page content. " | * This syntax renders TOC of a page inside the page content. " | ||
+ | ---- | ||
===== Configuration and Settings ===== | ===== Configuration and Settings ===== | ||
- | The plugin can be configured with the configuration manager | + | The plugin can be configured with the Configuration Manager |
- | + | ||
- | ^'' | + | |
- | |::: | 0: default(top-right) | + | |
- | |::: | 1: after First heading | | + | |
- | |::: | 2: after First Level 1 heading | | + | |
- | |::: | 3: disable Auto-TOC. To show TOC, you need to use '' | + | |
+ | ^'' | ||
+ | ^'' | ||
+ | |::: | 0: default (top-right) | ||
+ | |::: | 1: after the First Level 1 headline | | ||
+ | |::: | 2: after the First Level 2 headline | | ||
+ | |::: | 6: after the First headline | ||
+ | |::: | 9: disable %%auto-TOC%%. | ||
+ | ^'' | ||
+ | ^'' | ||
+ | ^'' | ||
+ | TocTweak plugin supersedes global config settings [[: | ||
+ | ---- | ||
===== Development ===== | ===== Development ===== | ||
- | === Change Log from github repository | + | ==== Backward incompatible changes ==== |
- | {{rss> | + | **ver.2 (2018-01-08)** |
+ | - Previously in version 1.x, '' | ||
+ | - DokuWiki %%Auto-TOC%% must exist only one per page whenever it should be shown. Use of '' | ||
- | === ToDo/Wish List === | + | ==== Change Log from github repository ==== |
- | * better code | + | |
- | * move TOC into the sidebar, like %%{{SIDETOC}}%% ? | + | |
- | * Option to disable the built-in TOC while keeping the Toctweak TOC enabled \\ -> done at 2014-04-26 release | + | |
+ | {{rss> | ||
- | ===== Known Bugs and Issues ===== | + | ==== Bug reports |
- | * The inlineToc doesn' | + | Please refer to the issue tracker (link button found at near page top) for reporting issues. |
- | + | ---- | |
- | ===== FAQ ===== | + | |
===== Discussion ===== | ===== Discussion ===== | ||
+ | Here are **obsoleted** topics of TocTweak plugin Version 1.x | ||
+ | |||
+ | ---- | ||
+ | |||
Awesome plugin! | Awesome plugin! | ||
I have one problem though... It seems like the '' | I have one problem though... It seems like the '' | ||
+ | |||
+ | > If you put '' | ||
---- | ---- | ||
Line 105: | Line 170: | ||
> Thanks for comment and reporting. I confirmed that ignored level values after class name parameter. I will update plugin code in sometime soon. --- [[user> | > Thanks for comment and reporting. I confirmed that ignored level values after class name parameter. I will update plugin code in sometime soon. --- [[user> | ||
> New release 2014-07-24! I hope the parameter order issue now fixed. | > New release 2014-07-24! I hope the parameter order issue now fixed. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | The inlineToc doesn' | ||
+ | |||
+ | ---- | ||
==== Feature Request ==== | ==== Feature Request ==== | ||
- | Enable users to call table of content via namespace as well. \\ | + | Enable users to call table of content via namespace as well. E.g. |
- | e.g. \\ | + | |
- | < | + | {{TOC:2-3 ns: |
- | {{TOC:2-3 ns: | + | |
- | </ | + | |
This displays the TOC for heading 2-3 for page-section id(#habits) in page(dog) in namespace (animals) into any page that calls this syntax. | This displays the TOC for heading 2-3 for page-section id(#habits) in page(dog) in namespace (animals) into any page that calls this syntax. | ||
- James 26/8/2014 | - James 26/8/2014 | ||
+ | |||
+ | ---- | ||
+ | Enable a TOC per section on a page that can be inserted under a header rather than a TOC for the entire page. | ||
+ | |||
+ | -Justin 25/6/2016 |
plugin/toctweak.1432060666.txt.gz · Last modified: 2015-05-19 20:37 by fnadde42