Welcome, Registration, and other StartingPoints; Foswiki history & Wiki style; All the docs...
Edit | Attach | New | Raw | Delete | History | Print | Tools

ExplicitNumberingPlugin

Use the ##., ##.. etc. notation to insert outline numbering sequences (1, 1.1, 2, 2.1) in topic's text.

Use ---#, ---##, etc., to generate numbered headings.

Use ##5., ##., ##. to start a numbering sequence at 5

Syntax Rules

1 Numbered sequences

  • 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 number n into the tag. For example, ##name#2... resets numbering sequence name to 2. The sequence is initialized from the indicated level on.
    • As a concession to backwards compatibility, 0 re-initializes the sequence at all levels. This comes in handy 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

2 Numbered headings

  • When the + character in headings is replaced by #, the headings are numbered. Heading numbers are derived from the unnamed sequence and can, therefore, be affected by the syntax above.
    • Tip: Avoid unnamed sequences when using numbered headings.

General comments

  • Numbering count is maintained throughout a single topic. Included topics are considered part of the topic and are numbered in sequence with the including topic.
  • The maximum number of levels is 6, and using levels higher than maximum implies the last level.
  • Non-consecutive increasing levels generate 0 for the skipped levels.
  • Sequence numbering always starts at level 1. A missing first level will result in a 0 to indicate the skipped level.
  • Non-numbered headers do not affect the numbering of numbered headings.

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
##. 3 1
##.. 3.1 1.1
##... 3.1.1 1.1.1
##.... 3.1.1.1 1.1.1.1
##..... 3.1.1.1.1 1.1.1.1.1
##...... 3.1.1.1.1.1 1.1.1.1.1.1
##....... 3.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)
##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 settings. To retrieve a preference setting write it as a Foswiki Macro: %<plugin>_ <setting>%, i.e. %EXPLICITNUMBERINGPLUGIN_SHORTDESCRIPTION%

Note: This plugin does not obtain preference settings from this topic. Settings should be entered in the SitePreferences or Web Preferences topic. The following settings can be used.

  • 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. Support also numbered headings.
  • Debug plugin: (See output in data/debug.txt)
    • Set DEBUG = 0
  • Bold font the numbering sequence
    • Set BOLD = 0

See also

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

Plugin Installation Instructions

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.

Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".

If you have any problems, or if the extension isn't available in configure, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.

Plugin Info

Plugin Author: TWiki:Main.MartinVlach, Foswiki:Main.ThomasWeigert (21 Nov 2006)
Copyright: © 2003, Lynguent, Inc. © 2006, ProjectContributor
License: GPL (GNU General Public License)
Plugin Version: 12 Feb 2009
Change History:  
4 Jun 2009: Added a bold preference option; Foswikitask:8167 (Foswiki:Main.SallyHoughton)
3 Mar 2009: Exclude textareas from rendering to improve compatibility with EditChapterPlugin. Completed rename to Foswiki namespace (Foswiki:Main.GeorgeClark); Foswikitask:1038
12 Feb 2009: Fixed regular expression to parse enumerated headings (Foswiki:Main.MichaelDaum); Added support for upper-case alphabetic enumerations (TWiki:Main.DarrenElkerton)
21 Nov 2006: Added reset to specific number based on suggestion by TWiki:Main.SteveWampler. Added support of numbered headers. Proper handling in table of content.
17 Sep 2003: Added alpha-labeled lists.
12 Aug 2003: Initialize sequences in startRenderingHandler. Thank you TWiki:Main.IngoKarkat.
29 Jul 2003: Initial version
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.8.0
Plugin Home: http://foswiki.org/Extensions/ExplicitNumberingPlugin

Related Topics: DefaultPreferences, SitePreferences, Plugins

-- Foswiki:Main.ThomasWeigert - 21 Nov 2006
spacer

Copyright © 2014 Atomikos BVBA. Transaction Management for Extreme Transaction Processing and SOA Environments serving ISV, Commercial, OEM and Open Source Markets
Site map RSS ATOM