DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:dokupp

DokuPP Plugin

Compatible with DokuWiki

Lemming

plugin DokuPP (DokuPlusPlus) provides automatic counters

Last updated on
2013-09-29
Provides
Syntax
Repository
Source

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to autonumbering

Tagged with counter, formatting, numbering

This plugin basically allows one to set up “magic counters” to provide numbering of items (nearly) anywhere one wants. If at some point you need to break and continue a numbered list and the list formatting plugins do not look like they would provide this easily, for example, then perhaps you can try this one!

Installation

Install the plugin using the Plugin Manager and the download URL above, which points to latest upstream version of the plugin. Refer to Plugins on how to install plugins manually.

:!: The author strongly recommends uninstalling previous versions of this plugin before installing to prevent class name conflicts.

Examples/Usage

See the plugin in action in the Official Demo Page. FIXME

Counter

You use the @#@ tag in order to insert an automatic counter. Every time you invoke this syntax, the counter is increased and the next number is displayed.

This creates a row of numbers starting at zero: 
@#@, @#@, @#@, @#@, @#@, @#@ and @#@.

Using this snippet you should see:

This creates a row of numbers starting at zero: 
0, 1, 2, 3, 4, 5 and 6.

Select and Setup

You can create your own, named counter, and assign an initial value to it. When you select a counter by name, all subsequent invocations of @#@ syntax will refer to that counter until you decide to select another one.

Select (or create) a counter named 'houses', starting at one: @#houses=1@
Select (or create) a counter named 'trees', starting at seven: @#trees=7@
Select the 'houses' counter again, continue where it left: @#houses=@
Select the default, unnamed counter, continue where it left: @#=@

Counter names must be single words in lowercase (eg.: “itemperemployee not item_per_employee or ItemPerEmployee).

The default (unnamed) counter starts at zero. To start it at a higher value select it with a new number: @#=number@.

@#=5@
The following shows the number @#@, and this @#@ showed the next number. 
After all that comes @#@.

Half way the counter was initialized to 5, for example, you should see this:

The following shows the number 5, and this 6 showed the next number. 
After all that comes 7.

Syntax

In the current version (2013-09) the following syntax is allowed:

  • Use @#=number@ to (re)initialize the default counter.
    • When left out the counter starts at zero
    • You can reinitialize the counter as much as you like.
  • Use @#@ to invoke the counter and display its current value.
  • Use @#name@ to select a new counter.
    • You can reinitialize them as much as you like as well: @#name=7@.

Initializing the counter (this produces no observable output by default):

@#=5@  // initializes with the value 5//

Invoking the counter:

The following shows the number @#@, and this @#@ showed the next number.
After all that comes @#@.

Limitations

Only one counter can exist in a page. Not anymore! Rejoice!

:!: Using insertion plugins like include may break the display of the counter.

Development

Caveats, sample snapshots and a ChangeLog are provided at the official demo site.

Issues can be submitted to the source repo's tracker (following or commenting on issues requires a login).

FAQ

No questions yet?

Discussion

No discussion yet?

plugin/dokupp.txt · Last modified: 2015-10-03 12:43 by Aleksandr