DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:indexnumber

indexnumber Plugin

Compatible with DokuWiki

Angua, Adora Belle, Weatherwax

plugin Insert numbered captions for images, tables etc.

Last updated on
2013-01-15
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, index, numbering

This DokuWiki syntax plugin creates counters with prefixes, for numbering and labeling images and tables with captions like “Tab. 1: Types of animals” or “Fig. 3”. The content between the idxnum tags will be wrapped in a <div> tag in the HTML output.

Individual counters and their prefix can be referenced with the [indexreference](https://github.com/gbirke/indexreference) plugin.

Installation

Copy the indexnumber folder into the lib/plugins folder of your DokuWiki installation.

If you want to insert specific counter names (see below), go to the Wiki configuration page and edit the field for index numbers configuration. Put each counter name on a new line.

If you want to have separator chars between the index number and the description you can also configure that on the wiki configuration page.

Examples/Usage

  This is the first image:
  <idxnum Fig.>
  {{computer.jpg}}
  </idxnum>
  
  This is the second image, with a description. Note that the id is arbitrary
  <idxnum Fig. #99 A beautiful tree>
  {{tree.jpg}}
  </idxnum>
  
  Interspersed table with a different counter:
  <idxnum Tab. #1 Some numbers>
  ^Foo^Bar^
  |42|47|
  |7|11|
  |6|0|
  </idxnum>
  
  Third image. Note how the counter is independent from id and the table counter
  <idxnum Fig. #4 Snowy landscape>
  {{snow.jpg}}
  </idxnum>
  

Syntax

Syntax for creating a counter number is

  <idxnum countername #id Description>
     some text, {image} or |table|
  </idxnum>

countername is an arbitrary string like “Tab.” or “Fig.” that must not contain the “#” character. All idxnum tags with the same counter name will produce sequential numbers. #id must be a number, prefixed by the # char. Each number must be unique for the page! The id can be used for referencing the generated number with the indexreference plugin. Description is an arbitrary description and will be added to the output after the index number. You can leave out the description but if you have a description you must have an id. If the description contains angle brackets, they must be escaped as their entities (&lt; and &gt;).

Please note that idxnum tags cannot be nested!

Change Log

Version 1.2
Release compatible with Angua and later

Version 1.1.1
Bugfix for Toolbar buttons

Version 1.1
Toolbar buttons

Version 1.0
First release

Discussion

Merge with indexreference?

Thanks for the plugin, Gabriel, it looks very promising! I expect it will be commonly used with the indexreference plugin. Wouldn't it make sense to merge them together into a single plugin to simplify installation? Thanks again. — Rik Blok 2013/01/19 07:51

Allow alphanumeric id?

This plugin looks like it'll help bring DokuWiki closer to a LaTeX-style document processing environment. Restricting id's to numbers could get in the way, though. In LaTeX cross-reference labels are intentionally not numbers so that the label isn't confused with the reference number. For example, <idxref Fig. 1> could be confusing if id 1 is the fourth numbered image on the page (counter = 4). An alphanumeric label, eg. <idxref Fig. mooreslaw> would be clearer. Just a thought. Thanks! — Rik Blok 2013/01/19 07:51

plugin/indexnumber.txt · Last modified: 2022-01-09 11:22 by Aleksandr

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