We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
You are here: TWiki> Plugins Web>TextSectionPlugin (03 Jun 2006, PeterThoeny)
Tags:
rendering1Add my vote for this tag create new tag
, view all tags

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.

%TEXTSECTION{title="cars"}% cars are motorized four weel vehicles.

%TEXTSECTION{title="Car details" use_form="1"}% Her are the car details ..... %TEXTSECTIONEND% %TEXTSECTIONEND%

%TEXTSECTION{title="bikes"}%

Bikes are unmotorized vehicles with two wheels.

For very young children sometimes four wheel bikes are used. smile

%TEXTSECTION{title="Bike details"}%

Her are the bike details .....

%TEXTSECTIONEND%

%TEXTSECTIONEND%


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 2006 (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 2006

Topic attachments
I Attachment Action Size Date Who Comment
zipzip TextSectionPlugin.zip manage 5.7 K 15 Feb 2006 - 08:57 NorbertWindrich Version for cairo and dakar, topic text from cairo release
Topic revision: r14 - 03 Jun 2006 - 22:37:19 - PeterThoeny
 
TWIKI.NET
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