DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:toctweak

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:toctweak [2018-01-06 14:37] s.saharaplugin:toctweak [2023-12-04 21:10] (current) – [Control macro for DokuWiki built-in TOC] Fix typo 177.208.41.57
Line 6: Line 6:
 email      : sahara.satoshi@gmail.com email      : sahara.satoshi@gmail.com
 type       : syntax, action type       : syntax, action
-lastupdate : 2017-12-09 +lastupdate : 2018-01-08 
-compatible : Binky, Ponder Stibbons, Hrun, Detritus, 2016-06-262017-02-19+compatible : Hrun, Detritus, Elenor of TsortFrusterick Manners, Greebo, Hogfather, Igor
 depends    :  depends    : 
 conflicts  : toc, inlinetoc, tocafterheadline conflicts  : toc, inlinetoc, tocafterheadline
Line 13: Line 13:
 tags       : toc tags       : toc
  
-downloadurl: https://github.com/ssahara/dw-plugin-toctweak/archive/2017-12-09.zip+downloadurl: https://github.com/ssahara/dw-plugin-toctweak/archive/2018-01-08.zip
 bugtracker : https://github.com/ssahara/dw-plugin-toctweak/issues bugtracker : https://github.com/ssahara/dw-plugin-toctweak/issues
 sourcerepo : https://github.com/ssahara/dw-plugin-toctweak sourcerepo : https://github.com/ssahara/dw-plugin-toctweak
Line 23: Line 23:
 ===== Installation ===== ===== Installation =====
  
-Install the plugin through the [[plugin:extension|Extension Manager]] using the download URL above, which points to latest version of the plugin. Refer to [[:plugin_installation_instructions|plugin installation instructions]].+Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
 Current development work in progress under Version 2.x series.    Current development work in progress under Version 2.x series.   
Line 39: Line 39:
  
 <code> <code>
-~~CLOSETOC~~         Let TOC box initially closed +~~CLOSETOC~~         Let the TOC box initially closed 
-~~TOC 2-3~~          Headlines within level 2 to 3 range are picked up in the TOC +~~TOC 2-3~~          Headlines within level 2 to 3 will appear in the TOC box 
-~~TOC 2-3 wide~~     Widen TOC box by assigning "wide" css class +~~NOTOC 2-3~~        No TOC box on the page, but set headline level parameter 
-~~TOC_HERE 2-3~~     TOC box will appear where the macro is placed in the page +~~TOC 2-3 wide~~     Widen the TOC box by assigning "wide" css class 
-~~NOTEC 2-3~~        No TOC box on the page, but set headline level parameters+~~TOC_HERE 2-3~~     Locate the TOC box where the macro is placed in the page
 </code> </code>
  
 == Note == == Note ==
-  * The built-in toc box should be one per page, therefore more than once "''%%~~TOC_HERE~~%%''" will be ignored+  * Headlines level parameter must be "//n-m//", "//n//" or "//-m"// format. 
-  * use headlines level parameters "//n-m//", "//n//" or "//-m"// where //n// means [[:config:toptoclevel]] and //m// means [[:config:maxtoclevel]].+  * The built-in toc box (or %%auto-TOC%%) should be one per page, therefore more than once "''%%~~TOC_HERE~~%%''" will be ignored.
  
 ==== METATOC: Another method to show TOC (in different looks/design)==== ==== METATOC: Another method to show TOC (in different looks/design)====
  
-{{ https://github.com/ssahara/dw-plugin-toctweak/raw/v2/example/image2.png?200|METATOC variants}}+{{ https://github.com/ssahara/dw-plugin-toctweak/raw/master/example/image2.png?200&recache|METATOC variants}}
  
-%%TOC%% Tweak 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.+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}}%%'' : Headline list with hierarchical numbers   - ''%%{{METATOC}}%%'' : Headline list with hierarchical numbers
Line 61: Line 61:
   - ''%%{{SIDETOC}}%%'' : dedicated to use in sidebar page   - ''%%{{SIDETOC}}%%'' : dedicated to use in sidebar page
  
-METATOC syntax family should render %%TOC%% of other page, with specified headline level range, starting section title, as well as %%TOC%% title.+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 >:wiki:syntax#Text Conversions | Text Conversions}}   {{METATOC 3-3 >:wiki:syntax#Text Conversions | Text Conversions}}
Line 69: Line 69:
  
 == Note == == Note ==
-  * The section title may contains spaces, therefore headline level parameter ("//n-m//"must be given before "%%>%%".+  * The section title may contains spaces, therefore headline level parameter must be given before "%%>%%".
   * set %%TOC%% title blank (given after "%%|%%") to remove default title -- "Table of Contents".   * set %%TOC%% title blank (given after "%%|%%") to remove default title -- "Table of Contents".
   * SIDETOC ignores //n-m// parameter, which will be retrieved from metadata of current page.   * SIDETOC ignores //n-m// parameter, which will be retrieved from metadata of current page.
- 
  
 ---- ----
Line 91: Line 90:
   * 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:<code>   * You can tweak either top or max level of headings, for example:<code>
-~~TOC:2~~ +~~TOC 2~~ 
-~~TOC:-3~~+~~TOC -3~~
 </code> </code>
  
Line 121: Line 120:
 The plugin can be configured with the Configuration Manager in the admin menu.  The plugin can be configured with the Configuration Manager in the admin menu. 
  
-^''tocPosition'' change always auto TOC position for normal pages  | +^''tocAllHeads''  | Store all headlines to page metadata                  | 
-|::: | 0: default (top-right)  +^''tocPosition'' Change always %%auto-TOC%% position for normal pages  | 
-|::: | 1: after First Level 1 headline| +|::: | 0: default (top-right)              
-|::: | 2: after First Level 2 headline | +|::: | 1: after the First Level 1 headline | 
-|::: | 6: after First headline | +|::: | 2: after the First Level 2 headline | 
-|::: | 9: disable Auto-%%TOC%%. To show %%TOC%%, you need to use ''%%{{TOC}}%%'' or ''%%{{INLINETOC}}%%''  +|::: | 6: after the First headline         
-^''toptoclevel'' highest headline level which can appear in table of contents  +|::: | 9: disable %%auto-TOC%%.            
-^''maxtoclevel'' lowest headline level to include in table of contents  +^''toptoclevel'' Upper level of headline which can appear in table of contents        
-^''tocminheads'' minimum amount of headlines to show table of contents  |+^''maxtoclevel'' Lower level of headline which can appear in table of contents        
 +^''tocminheads'' Minimum amount of headlines that determins whether the TOC is built  |
  
 +TocTweak plugin supersedes global config settings [[:config:toptoclevel]], [[:config:maxtoclevel]] and [[:config:tocminheads]]. Especially when **tocAllHeads** is on, global toptoclevel and maxtoclevel values are set to 1 and 5 respectively.
  
 ---- ----
Line 138: Line 139:
 ==== Backward incompatible changes ==== ==== Backward incompatible changes ====
  
-**ver.2 (not yet released)**+**ver.2 (2018-01-08)**
   - Previously in version 1.x, ''%%{{TOC}}%%'' syntax was available to move DokuWiki %%Auto-TOC%% box from top right corner to other place inside the page. Since version 2.x, it has changed to render METATOC instead of %%Auto-TOC%%. Alternative ''%%~~TOC_HERE~~%%'' macro is available.   - Previously in version 1.x, ''%%{{TOC}}%%'' syntax was available to move DokuWiki %%Auto-TOC%% box from top right corner to other place inside the page. Since version 2.x, it has changed to render METATOC instead of %%Auto-TOC%%. Alternative ''%%~~TOC_HERE~~%%'' macro is available.
   - DokuWiki %%Auto-TOC%% must exist only one per page whenever it should be shown. Use of ''%%~~TOC_HERE~~%%'' macro is restricted to once in a page.   - DokuWiki %%Auto-TOC%% must exist only one per page whenever it should be shown. Use of ''%%~~TOC_HERE~~%%'' macro is restricted to once in a page.
  
- +==== Change Log from github repository ====
-=== Change Log from github repository ===+
  
 {{rss>https://github.com/ssahara/dw-plugin-toctweak/commits/master.atom date}} {{rss>https://github.com/ssahara/dw-plugin-toctweak/commits/master.atom date}}
- 
-=== ToDo/Wish List === 
- 
-  * 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 
  
 ==== Bug reports and feature requests ==== ==== Bug reports and feature requests ====
Line 160: Line 154:
  
 ===== Discussion ===== ===== Discussion =====
-Here are **obsoleted** topics of %%TOC%% Tweak plugin Version 1.x+Here are **obsoleted** topics of TocTweak plugin Version 1.x
  
 ---- ----
plugin/toctweak.1515245832.txt.gz · Last modified: 2018-01-06 14:37 by s.sahara

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