ANNUNCIO: L'aggiornamento dei pacchetti ISI produce importanti cambiamenti,
leggete questa nota 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.
Syntax Rules
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
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 |
##. | 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. Support also numbered headings.
- Debug plugin: (See output in
data/debug.txt
)
See also
There is an active development going on using the ---+++1.1.2 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
ExplicitNumberingPlugin.zip
in your twiki installation directory. Content: File: | Description: |
data/TWiki/ExplicitNumberingPlugin.txt | Plugin topic |
lib/TWiki/Plugins/ExplicitNumberingPlugin.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
Related Topics: TWikiPreferences,
TWikiPlugins
--
TWiki:Main.ThomasWeigert - 21 Nov 2021