plugin:numberedheadings
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
plugin:numberedheadings [2019-08-24 06:53] – new release s.sahara | plugin:numberedheadings [2019-09-09 14:33] – s.sahara | ||
---|---|---|---|
Line 6: | Line 6: | ||
email : sahara.satoshi@gmail.com | email : sahara.satoshi@gmail.com | ||
type : syntax | type : syntax | ||
- | lastupdate : 2019-08-24 | + | lastupdate : 2019-09-09 |
compatible : 2013-06-03, 2014-09-29 2015-08-10, 2018-04-22 | compatible : 2013-06-03, 2014-09-29 2015-08-10, 2018-04-22 | ||
depends | depends | ||
Line 27: | Line 27: | ||
===== Usage ===== | ===== Usage ===== | ||
- | To use this plugin just add a ' | + | Adding |
====== - Level 1 Headline ====== | ====== - Level 1 Headline ====== | ||
===== - Level 2 Headline ===== | ===== - Level 2 Headline ===== | ||
+ | ==== -#5 Level 3 Headline ==== | ||
==== - Level 3 Headline ==== | ==== - Level 3 Headline ==== | ||
+ | ===== -#7 Level 2 Headline ===== | ||
==== - Level 3 Headline ==== | ==== - Level 3 Headline ==== | ||
- | ===== - Level 2 Headline ===== | ||
- | ==== - Level 3 Headline ==== | ||
- | ... | ||
- | The output should then look like this: | ||
- | 1. Level 1 Headline | ||
- | 1.1 Level 2 Headline | ||
- | 1.1.1 Level 3 Headline | ||
- | 1.1.2 Level 3 Headline | ||
- | 1.2 Level 2 Headline | ||
- | 1.2.1 Level 3 Headline | ||
- | ... | ||
+ | When the config **tier1** is set to 2, the headings are interpreted as if you have written: | ||
+ | ====== Level 1 Headline ====== | ||
+ | ===== 1. Level 2 Headline ===== | ||
+ | ==== 1.5 Level 3 Headline ==== | ||
+ | ==== 1.6 Level 3 Headline ==== | ||
+ | ===== 7. Level 2 Headline ===== | ||
+ | ==== 7.1 Level 3 Headline ==== | ||
+ | | ||
+ | === Experimental: | ||
+ | Character variables can be incremented in PHP, like A0, A1, A2 ... You can use '' | ||
- | The user can also set the outline level with the following markup (Thanks to [[martin@idea-games.com|Martin Klima]]): | + | |
- | + | === - headline | |
- | === -#< | + | |
- | + | ||
- | For example: | + | |
- | + | ||
- | ====== -#3 Level 1 Headline ====== | + | |
- | | + | |
- | + | ||
- | will be rendered | + | |
- | + | ||
- | 3 Level 1 Headline | + | |
- | 3.1 Level 2 Headline | + | |
Line 69: | Line 60: | ||
^ fancy | styled heading numbers | default = **off** | | ^ fancy | styled heading numbers | default = **off** | | ||
- | The default numbering format : '' | + | ==== Auto-Detect first-tier level ==== |
- | The example above generates | + | When the config **tier1** is '' |
- | Level 1 Headline | + | ==== Numbering format ==== |
- | 1. Level 2 Headline | + | |
- | 1.1. Level 3 Headline | + | |
- | 1.2. Level 3 Headline | + | |
- | 2. Level 2 Headline | + | |
- | 2.1. Level 3 Headline | + | |
- | ... | + | |
- | You can also override the startlevel | + | The config **format** defines tiered numbering style. Each tier format is the formatting string of [[phpfn> |
+ | Some format examples:< | ||
+ | [" | ||
+ | [" | ||
+ | [" | ||
+ | </ | ||
+ | |||
+ | ==== Control numbering feature ==== | ||
+ | |||
+ | The numbered headings that are prefixed with "'' | ||
+ | |||
+ | < | ||
+ | assume config tier1 is set to 0 | ||
+ | === --#1000 [" | ||
+ | === - item 1 === → (1001) item 1 | ||
+ | === -- === ... initialize tier1, format, headings counter | ||
+ | ==== - item 2 ==== → 1. item 2 | ||
+ | </ | ||
+ | |||
+ | You can also override the first-tier level in a per-page basis. Just insert this code to your page: | ||
< | < | ||
~~HEADLINE NUMBERING FIRST LEVEL = n~~ | ~~HEADLINE NUMBERING FIRST LEVEL = n~~ | ||
Line 87: | Line 91: | ||
Where '' | Where '' | ||
- | |||
- | |||
- | |||
Line 98: | Line 99: | ||
Since 2019-01-02, the plugin code has moved to github repository to provide better accessibility for install and further development opportunity. Thanks Lars J. Metz for your early work and encouraging me to move the code to github. | Since 2019-01-02, the plugin code has moved to github repository to provide better accessibility for install and further development opportunity. Thanks Lars J. Metz for your early work and encouraging me to move the code to github. | ||
- | |||
- | === Idea for Improvement | ||
- | - use vsprintf() to build tiered numbers label, obsolete config " | ||
- | - initialise class properties after PARSER_HANDLER_DONE event to prevent wrong numbering | ||
Line 109: | Line 106: | ||
- | === Revision List === | + | === Old Revision List === |
* 2006-08-25 --- Published Plugin | * 2006-08-25 --- Published Plugin |
plugin/numberedheadings.txt · Last modified: 2023-09-13 08:34 by s-sahara