Skip to topic | Skip to bottom
Home
TWiki
TWiki.ExplicitNumberingPluginr1.1 - 17 Sep 2003 - 21:09 - TWikiGuesttopic end

Start of topic | Skip to actions

ExplicitNumberingPlugin

Use the ##., ##.. etc. notation (that is, hash-hash-dot-dot-dot...) to insert outline numbering sequences (1, 1.1, 2, 2.1) in topic's text. Multiple named sequences and sequence re-initialization is supported.

Syntax Rules

  • The default outline numbering sequence uses the notation ##... (with 1-6 dots). The notation is replaced anywhere in the topic. The level number corresponding to the number of dots increases with each use. Each time a level is used, all higher levels are reset to 0.

  • Named numbering sequences can be used with the notation ##name#... for sequence name. Named sequences have independent numbering.

  • The numbering of a sequence can be initialized or re-initialized by adding a 0 into to notation: ##name#0... anywhere in the topic. All numbers are re-initialized. This is essential when using a sequence within headers that are also used in a %TOC%. In that case, start the first heading using something like ---+ Chapter ##0. Introduction. You can then safely use the number notation in headings.

  • The rendering of the numbering sequence can be turned into an letter-labeled list by appending a lowercase letter to the notation: ##...a

  • The maximum number of levels is 6, and using levels higher than maximum implies the last level.

Examples

If you have the plugin installed, the Rendered and Expected columns should be identical. If you do not have the plugin installed, the Rendered column will be the same as the Source column.

Source Rendered Expected
##. 1 1
##.. 1.1 1.1
##... 1.1.1 1.1.1
##.... 1.1.1.1 1.1.1.1
##..... 1.1.1.1.1 1.1.1.1.1
##...... 1.1.1.1.1.1 1.1.1.1.1.1
##....... 1.1.1.1.1.2 1.1.1.1.1.2
Chapter ##a#. Chapter 1 Chapter 1
Section ##a#.. Section 1.1 Section 1.1
Subsection ##a#... Subsection 1.1.1 Subsection 1.1.1
Req ##a#....: Req 1.1.1.1: Req 1.1.1.1:
Req ##a#....: Req 1.1.1.2: Req 1.1.1.2:
Subsection ##a#... Subsection 1.1.2 Subsection 1.1.2
Req ##a#....: Req 1.1.2.1: Req 1.1.2.1:
Req ##a#....: Req 1.1.2.2: Req 1.1.2.2:
##a#....a) a) a)
##a#....a) b) b)
Req ##a#....: Req 1.1.2.3: Req 1.1.2.3:
Section ##a#.. Section 1.2 Section 1.2
Chapter ##a#. Chapter 2 Chapter 2
Section ##a#.. Section 2.1 Section 2.1
Section ##a#.. Section 2.2 Section 2.2

ExplicitNumberingPlugin Global Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, i.e. %EXPLICITNUMBERINGPLUGIN_SHORTDESCRIPTION%

  • One line description, is shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Use the ##., ##.. etc. notation to insert outline numbering sequences (1, 1.1, 2, 2.1) in topic's text. Multiple named sequences and sequence re-initialization is supported.

  • Debug plugin: (See output in data/debug.txt)
    • Set DEBUG = 0

See also

There is an active development going on using the ---### notation for numbered headers. See TWiki:Codev.NumberedHeadersAndLists.

The TWiki:Plugin.TocPlugin provides a more complete table of contents and cross-reference management.

Copyright

This code is a development of Lynguent Inc. and is protected by the following copyrights:

  • Copyright (C) 2003 Lynguent, Inc. All Rights Reserved.

License

As required for the publication of all extensions to TWiki, this software is published under the terms of the GNU General Public License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details, published at http://www.gnu.org/copyleft/gpl.html

Plugin Installation Instructions

Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.

  • Download the ZIP file from the Plugin web (see below)
  • Unzip ExplicitNumberingPlugin.zip in your twiki installation directory. Content: | File: | Description: | | data/TWiki/ExplicitNumberingPlugin.txt | Plugin topic | | lib/TWiki/Plugins/ExplicitNumberingPlugin.pm | Plugin Perl module |
  • Test if the installation was successful:
    • See the Examples section above. The table columns Rendered and Expected should have the same values.

Plugin Info

Plugin Author: TWiki:Main/guest
Plugin Version: 17 Sep 2003 (V1.002)
Change History:  
29 Jul 2003: Initial version
12 Aug 2003: Initialize sequences in startRenderingHandler. Thank you TWiki:Main.IngoKarkat.
17 Sep 2003: Added alpha-labeled lists.
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.8.0
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/ExplicitNumberingPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/ExplicitNumberingPluginDev

Related Topics: TWikiPreferences, TWikiPlugins

-- TWiki:Main.MartinVlach - 17 Sep 2003
to top


You are here: TWiki > ExplicitNumberingPlugin

to top

Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback