This plugin allows the use of multiples counters with multiples levels, within the same page
Compatible with DokuWiki
2012-01-25c "Angua", 2012-10-13 "Adora Belle", 2013-05-10a "Weatherwax", 2017-02-19 "Frusterick Manners"
Similar to dokupp, indexnumber
This plugin doesn't work in headlines and this can't be fixed.
See forum: https://forum.dokuwiki.org/d/9334
Syntax: ~~#~~
~~#~~
will be replaced by a number, auto incremented, and saved in a common counter.Example:
Example number ~~#~~ Example number ~~#~~ Example number ~~#~~ -------------------- Result: Example number 1 Example number 2 Example number 3
Syntax: ~~#@COUNTERID~~
COUNTERID
is an alphanumeric identificator, including underscore, and starting with a @
. This allows the use of multiple counters.Example:
First counter = ~~#@ctr_ONE~~ First counter = ~~#@ctr_ONE~~ First counter = ~~#@ctr_ONE~~ Second counter = ~~#@ctr_TWO~~ Second counter = ~~#@ctr_TWO~~ First counter = ~~#@ctr_ONE~~ -------------------- Result: First counter = 1 First counter = 2 First counter = 3 Second counter = 1 Second counter = 2 First counter = 4
Syntax: ~~#NUM~~
NUM
is a positive number that will be the begining of the auto incrementation from there.Example:
Counter = ~~#~~ Counter = ~~#6~~ Counter = ~~#~~ -------------------- Result: Counter = 1 Counter = 6 Counter = 7
Syntax: ~~#.#~~
.#
represent a sublevel and can be repeated as much as needed.Example:
Level = ~~#~~ Level = ~~#.#~~ Level = ~~#.#.#~~ Level = ~~#.#.#~~ Level = ~~#.#~~ Level = ~~#.#.#~~ Level = ~~#.#.#~~ Level = ~~#~~ -------------------- Result: Level = 1 Level = 1.1 Level = 1.1.1 Level = 1.1.2 Level = 1.2 Level = 1.2.1 Level = 1.2.2 Level = 2
Syntax: ~~TEXT.#~~
TEXT
is alphabetic (without number) and will be reproduce in the number. Only #
is an auto incremented number.Example 1:
~~Kung.Fu.#~~ ~~Kung.Fu.#.#~~ ~~Kung.Fu.#.#~~ ~~Kung.Fu.#~~ ~~Kung.Fu.#.#.#~~ ~~Kung.Fu.#.#.#~~ -------------------- Result: Kung Fu 1 Kung Fu 1.1 Kung Fu 1.2 Kung Fu 2 Kung Fu 2.1.1 Kung Fu 2.1.2
The numbers are wrapped with a <span class=“…”>
tag with two classes: autonumberingAll
and autonumbering
followed by all text-only levels separated by an underscore. For example:
~~#~~
becomes <span class=“autonumberingAll autonumbering”>1</span>
~~Kung.Fu.#.#~~
becomes: <span class=“autonumberingAll autonumbering_Kung_Fu”>Kung Fu 1.1</span>
To style this, one may create a conf/tpl/<template name>/
directory, create a file style.ini
in the directory, and define there a custom css, for example:
[stylesheets] css/autonumbering.css = screen
Then, in the css/autonumbering.css
(all path relative to conf/tpl/<template name>/
), one may write:
.autonumbering_Kung_Fu { font-style: italic; text-decoration: #2b73b7 underline; }
I republished this plugin as I found it useful. The original code is by Patrice Bonneau.