Jan
FEB
Mar
25
2008
2009
2010
1 capture
25 Feb 09 - 25 Feb 09
Close
Help
E
dit
A
ttach
P
rintable
r2 - 04 Aug 2008 - 10:18:31 -
TWikiAdminUser
You are here:
TWiki
>
TWiki Web
>
ExplicitNumberingPlugin
---+ <nop>%TOPIC% Use the ==#<nop>#.==, ==#<nop>#..== _etc._ notation to insert outline numbering sequences (1, 1.1, 2, 2.1) in topic's text. Use ==---#<nop>==, ==---#<nop>#==, _etc._, to generate numbered headings. ---++ Syntax Rules ---+++ Numbered sequences * The default outline numbering sequence uses the notation =#<nop>#...= (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 =#<nop>#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, =#<nop>#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 *%<nop>TOC%*. In that case, start the first heading using something like =---+ Chapter #<nop>#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: =#<nop>#...a= ---+++ 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* | | #<nop>#. | ##. | 1 | | #<nop>#.. | ##.. | 1.1 | | #<nop>#... | ##... | 1.1.1 | | #<nop>#.... | ##.... | 1.1.1.1 | | #<nop>#..... | ##..... | 1.1.1.1.1 | | #<nop>#...... | ##...... | 1.1.1.1.1.1 | | #<nop>#....... | ##....... | 1.1.1.1.1.2 | | Chapter #<nop>#a#. | Chapter ##a#. | Chapter 1 | | Section #<nop>#a#.. | Section ##a#.. | Section 1.1 | | Subsection #<nop>#a#... | Subsection ##a#... | Subsection 1.1.1 | | Req #<nop>#a#....: | Req ##a#....: | Req 1.1.1.1: | | Req #<nop>#a#....: | Req ##a#....: | Req 1.1.1.2: | | Subsection #<nop>#a#... | Subsection ##a#... | Subsection 1.1.2 | | Req #<nop>#a#....: | Req ##a#....: | Req 1.1.2.1: | | Req #<nop>#a#....: | Req ##a#....: | Req 1.1.2.2: | | #<nop>#a#....a) | ##a#....a) | a) | | #<nop>#a#....a) | ##a#....a) | b) | | Req #<nop>#a#....: | Req ##a#....: | Req 1.1.2.3: | | Section #<nop>#a#.. | Section ##a#.. | Section 1.2 | | Chapter #<nop>#a#. | Chapter ##a#. | Chapter 2 | | Section #<nop>#a#.. | Section ##a#.. | Section 2.1 | | Section #<nop>#a#.. | Section ##a#.. | Section 2.2 | ---++ <nop>%TOPIC% Global Settings Plugin settings are stored as preferences variables. To reference a plugin setting write ==%<nop><plugin>_<setting>%==, i.e. ==%<nop>EXPLICITNUMBERINGPLUGIN_SHORTDESCRIPTION%== * One line description, is shown in the %TWIKIWEB%.TextFormattingRules topic: * Set SHORTDESCRIPTION = Use the ==#<nop>#.==, ==#<nop>#..== _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 ---++ 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. ---++ 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 ==%TOPIC%.zip== in your twiki installation directory. Content: | *File:* | *Description:* | | ==data/TWiki/%TOPIC%.txt== | Plugin topic | | ==lib/TWiki/Plugins/%TOPIC%.pm== | Plugin Perl module | * (Dakar) Visit =configure= in your TWiki installation, and enable the plugin in the {Plugins} section. * 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/MartinVlach, TWiki:Main.ThomasWeigert (21 Nov 2006) | | Copyright: | © 2003, Lynguent, Inc. © 2006, %TWIKIWEB%.TWikiContributor | | License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) | | Plugin Version: | 21 Nov 2006 | | Change History: | <!-- versions below in reverse order --> | | 21 Nov 2006: | Added reset to specific number based on suggestion by 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 | | TWiki Dependency: | $TWiki::Plugins::VERSION 1.1 | | CPAN Dependencies: | none | | Other Dependencies: | none | | Perl Version: | 5.8.0 | | Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% | | Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev | __Related Topics:__ %TWIKIWEB%.TWikiPreferences, %TWIKIWEB%.TWikiPlugins -- TWiki:Main.ThomasWeigert - 21 Nov 2006
E
dit
|
A
ttach
|
P
rintable
|
V
iew topic
|
Backlinks:
We
b
,
A
l
l Webs
|
H
istory
: r2
<
r1
|
M
ore topic actions
TWiki
Log In
or
Register
TWiki Web
Users
Groups
Index
Search
Changes
Notifications
Statistics
Preferences
User Reference
ATasteOfTWiki
TextFormattingRules
TWikiVariables
FormattedSearch
TWikiDocGraphics
TWikiSkinBrowser
InstalledPlugins
Admin Maintenance
Reference Manual
AdminToolsCategory
InterWikis
ManagingWebs
TWikiSiteTools
TWikiPreferences
WebPreferences
Categories
Admin Documentation
Admin Tools
Developer Doc
User Documentation
User Tools
Webs
ATLAS
AUGER
FZU
ILC
Sandbox
TWiki
VS
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback
Note:
Please contribute updates to this topic on TWiki.org at TWiki:TWiki.ExplicitNumberingPlugin