DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:numbering

Numbering Plugin

Compatible with DokuWiki

  • 2016-06-26 "Elenor Of Tsort" yes
  • 2015-08-10 "Detritus" yes
  • 2014-09-29 "Hrun" yes
  • 2014-05-05 "Ponder Stibbons" yes

plugin Sequential Numbering

Last updated on
2015-09-29
Provides
Action
Repository
Source

Tagged with numbering

Installation

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

This plugin requires JQuery and therefore will not work in versions of DokuWiki earlier than Angua.

Examples/Usage

This plugin installs the the toolbar button shown at the left. When clicked it outputs a formatted number string. This number is unique and next in sequence. The plugin can be used in multi-user wikis: a new number will not be output until the previous number has been processed.

In addition to the unique number, the output string can include images, text and date. All of this is controlled by configuration options set in the Configuration Manager. The default output is as follows:

Number: 00001003 –2013/03/18 09:40

This string can have many different formats and the number can be left padded with whatever character you choose. The default is padding “0”. Inclusion of the date is optional and so, too, is text, such as the word “Number” in the above example. You might, instead, have “Invoice number: ”, for instance, or “ID: ”, etc.

You can also include images in the output string–a company logo, a separator, etc. For instance:

Configuration and Settings

Options Set in Configuration Manager

Option Default Value Description
nstart 0 The number-1 at which you want to start your count
padding 0 Character to pad the number with, if the number is smaller than the minimum number of digits desired for the number
pad_length 8 The minimum number of digits in the number string. This does not control the size of the number itself, which can outgrow the padded size.
set_date true If set to true the date will be printed with the number
datestyle '//'.$conf['dformat'].'//' This sets the date format for strftime, which can include DokuWiki format specifiers for bold, italic, etc. The default uses italics and the format specified by dformat.
use_imgs false If set to true, the plugin will attempt to insert images into the format string
format Number: %n –%d Format string, where %d represents the date and %n the number and %i<n> image number n. Like the date style this can also take format specifiers. For instance: ** Date: %d Number: %n **
imgs Comma separated list of images located in data/media,
e.g :image.png,:wiki:other_image.png, . . ..
These will be inserted into the format string in the order in which they are listed at positions %i1. . . %i<n>

The image settings can include sizes. For instance: :wiki:dokuwiki-128.png?50. This is the technique used in the example above, which used this format string:

  %i1 Document Number: %n --%d 

Markup other than character formatting can be included in the format string. For instance, you can put the output on two lines:

   Document Number: %n \\  --%d 

This will give you:

Document Number: 00001022
–2013/03/19 07:14

Tool tip

When you run your mouse over the numbering icon, the current tool tip which pops up is “Insert next number”. You can change this in the file title.js found in the plugin directory. This file has one line:

  var NumberingToolBarTtitle =  ""; //"Insert your number";

The tool tip can be reset to anything you wish by resetting the tool tip variable shown above.

Development

Change Log

Known Bugs and Issues

Discussion

plugin/numbering.txt · Last modified: 2017-01-11 03:11 by turnermm