ANNUNCIO: L'aggiornamento dei pacchetti ISI produce importanti cambiamenti,
leggete questa nota
This plugin adds the ability to do nested, segmented rendering in topics (section). The plugin has two modes, a heading and a section mode. The modes can´t be mixed in a topic.
Texts outside of sections will be rendered normally. Texts within a section are hidden first. A '+' symbol shows a hidden section. After selecting the '+' symbol the contents of this section gets visible. The '+' indicator changes to a '-' to indicate this. To hide a visible section select the '-' symbol. The '-' symbol changes back to a '+'.
A section can have nested sections. Nested sections are visible only in a visible parent section.
Heading mode
A section starts on a heading item and ends on the next same heading item level. A nested section is started on a deeper heading level. To activate the heading mode just insert a %textsections% in the topic.
Syntax Rules
%TEXTSECTIONS%
Examples
Example 1: same heading level
%TEXTSECTIONS% => activate textsection heading mode
---+ chapter 1: first level 1 heading => Beginning of a section
---+ chapter 2: second level 1 heading => Ends first section and starts next section
Example 2: nested headings
%TEXTSECTIONS% => activate textsection heading mode
---+ chapter 1: first level 1 heading => Beginning of first level 1 section
---++ chapter 1.1: first level 1.1 heading => Beginning of level 1.1 section
---+ chapter 2: second level 1 heading => Ends level 1 and level 1.1 section, begin of next level 1 section
Section mode
Each textsection consists of a start (%textsection% or %textsection{...}% and an end (%textsectionend%).
Syntax Rules
- Note: multiple %TEXTSECTION% / %TEXTSECTIONEND% should not be in one line. The {} is optional.
Params
The parameters of a %TEXTSECTION{...}% consists of one or more of the following values:
- hidenum: Hide numbering (0 | 1)
> no | yes =
(Example: hidenum="1")
- title: Button text == (Example: title="Capter 1")
- use_form: Button text (0 | 1)
> no | yes =
(Example: use_form="1")
Default is to hide the numbering, no title and don´t use a form.
Example
This is an Overview of vehicles.
+ 1. cars
+ 2. bikes
TextSectionPlugin Global Settings
Plugin settings are stored as preferences variables. To reference a plugin setting write
%<plugin>_<setting>%
, i.e.
%INTERWIKIPLUGIN_SHORTDESCRIPTION%
- One line description, is shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = Adds sectional rendering
- Skip textsection generation for specific skins (for example: print)
- Set SKIPSKIN = print koalaprint
- Use form button instead of a hyperlink (for section mode only)
- Debug plugin: (See output in
data/debug.txt
)
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
TextSectionPlugin.zip
in your twiki installation directory. Content: File: | Description: |
data/TWiki/TextSectionPlugin.txt | Plugin topic |
lib/TWiki/Plugins/TextSectionPlugin.pm | Plugin Perl module |
- See the examples above to check if the installation was successful.
Plugin Info
Related Topics: TWikiPreferences,
TWikiPlugins
--
TWiki:Main.NorbertWindrich - 14 Feb 2022