r3 - 15 Feb 2022 - 09:49:40 - Main.nwindricYou are here: TWiki >  TWiki Web > TextSectionPlugin
ANNUNCIO: L'aggiornamento dei pacchetti ISI produce importanti cambiamenti, leggete questa nota

TextSectionPlugin

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

  • section start
    • %TEXTSECTION%

    • %TEXTSECTION{params}%

  • section end
    • %TEXTSECTIONEND%

  • 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)
    • Set USE_FORM =

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

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

Plugin Author: TWiki:Main.NorbertWindrich
Copyright: © 2004-2006, Norbert Windrich
License: GPL (GNU General Public License)
Plugin Version: 14 Feb 2022 (Dakar V2.000)
Change History:  
14 Feb 2006: Same plugin code for cairo and dakar
10 Feb 2006: Updates for dakar release, tags are now in uppercase only like other twiki tags
18 Aug 2004: move to twiki syntax for tokens use of "%" instead of "\<\>"
13 Aug 2004: added heading mode functionality
06 Aug 2004: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.024
CPAN Dependencies: none
Other Dependencies:  
Perl Version: 5.005
Benchmarks: GoodStyle nn%, FormattedSearch nn%, TextSectionPlugin nn%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/TextSectionPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/TextSectionPluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/TextSectionPluginAppraisal

Related Topics: TWikiPreferences, TWikiPlugins

-- TWiki:Main.NorbertWindrich - 14 Feb 2022

 

This site is powered by the TWiki collaboration platformCopyright © 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.TextSectionPlugin