ThreadedDiscussionPlugin
Generates a threaded discussion. Each discussion point can be edited
individually, and discussion points can be commented on individually.
Syntax Rules
DISCUSSION Variable
- Place the variable
%DISCUSSION{...}%
before any bullet list.
- Supported parameters:
"(list|thread)" | Rendering style for discussion, see STYLE preference: =list= formats the discussion as a bullet list; the level of discussion is indicated by the indentation and the associated bullet symbol "thread" formats the discussion with colored thread lines to the left indicating the level. |
focus="text" | Focus list on a bullet containing the specified text. If no depth (see below) is specified, focus limits the depth to the focus item plus two levels. |
depth="number" | Hide bullets with an indent greater then depth. The depth is relative to the highlighted bullet in case focus is specified |
interactive="(on|off)" | If on , the discussion is followed by a control allowing selection of depth and focus interactively. |
- To start a discussion, omit the bullet list. Any text that immediatly follows the
%DISCUSSION{...}%
variable on the same line is shown, but removed when the first discussion point is entered. This may serve as an introductory text inviting initiation of the discussion.
Bullets
- Use regular
*
bullets
- Start with level one
- Increase indentation only one level at a time
- Decreasing indentation many levels at a time is fine
- You can specify an icon for a bullet:
- Attach the icon to a topic, e.g.
myicon.gif
, or
- Use one of the existing icons from TWikiDocGraphics
- Refer to an attached icon at the beginning of the bullet with:
-
icon:myicon Followed by normal bullet text
Usage
- You can turn any bullet list into a threaded discussion by prefixing the list with the
%DISCUSSION{...}%
variable.
- You can edit each item of the bulleted list individually, and you can add further items by creating them individually.
- Click on the
EDITLABEL
to edit the text at the selected item.
- Click on the
COMMENTLABEL
to insert a comment to the current item. The comment is inserted as the last item at the next level of indentation.
- Each item will become a list item. Consequentially, it may not contain newlines, lest the list will be interrupted. (However, each item can be arbitrarily long, and it will be rendered with the lines wrapped to page width.)
- To start a new discussion, just insert the
%DISCUSSION{...}%
variable, immediately followed by some text. This text will be deleted when the first discussion item is added (click on either of the icons to edit a new item).
Examples
You type:
|
You get: (simulated)
|
You get: (if installed)
|
%DISCUSSION{"thread"}%
* one
* one.a
* one.a.x
* one.b
* one.b.x
continue
* one.b.y
* icon:person Tim
* icon:person Mico
* two
* three
|
|
|
You type:
|
You get: (simulated)
|
You get: (if installed)
|
%DISCUSSION{"thread" focus="Tim"}%
* one
* one.a
* one.a.x
* one.b
* one.b.x
continue
* one.b.y
* icon:person Tim
* icon:person Mico
* two
* three
|
|
|
You type:
|
You get: (simulated)
|
You get: (if installed)
|
%DISCUSSION{"thread" depth="2"}%
* one
* one.a
* one.a.x
* one.b
* one.b.x
continue
* one.b.y
* icon:person Tim
* icon:person Mico
* two
* three
|
|
|
You type:
|
You get: (simulated)
|
You get: (if installed)
|
%DISCUSSION{"list"}%Start a discussion
|
Start a discussion.   |
|
Start a discussion Edit Comment
|
ThreadedDiscussionPlugin Settings
Plugin settings are stored as preferences variables. To reference a plugin setting write
%<plugin>_<setting>%
, i.e.
%THREADEDDISCUSSIONPLUGIN_SHORTDESCRIPTION%
- One line description, is shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = Support a threaded discussion mode.
- Debug plugin: (See output in
data/debug.txt
)
- Determines how the discussion list will be rendered:
list
formats the discussion as an indented bullet list; thread
formats the discussion with thread bars indicating the depth of the discussion.
- Formatting preferences for the
thread
style
- Color, style, and thickness of line indicating thread as valid for the HTML style attribute
- Set THREADCOLOR = solid thin #FFCCCC
- #Set THREADCOLOR = dotted medium black
- Additional icon separating thread lines
- Set SPACEICON = 1, 16, 16, empty.gif
- The first element is a
0|1
flag indicating whether to suppress or show thread lines at the top level; the next two arguments indicate width and height of icons, respectively; and the final argument gives the spacer icon between thread lines.
- Topic at which icons are attached, unless explicitly given.
- Labels for the edit and comment buttons. Can be textual or icons.
- Set EDITLABEL = Edit
- #Set EDITLABEL =
- Set COMMENTLABEL = Comment
- #Set COMMENTLABEL =
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
ThreadedDiscussionPlugin.zip
in your twiki installation directory. Content:
File: | Description: |
data/TWiki/ThreadedDiscussionPlugin.txt | Plugin topic |
data/TWiki/ThreadedDiscussionPlugin.txt,v | Plugin topic repository |
lib/TWiki/Plugins/ThreadedDiscussionPlugin.pm | Plugin Perl module |
bin/editthread | edit script |
- Test if the installation was successful:
- See if the above example works
Acknowledgment
This plugin was inspired by the
TWiki:Plugins/RenderListPlugin and
borrows code heavily from it.
Plugin Info
Related Topics: TWiki:Plugins/EditContrib,
TWiki:Plugins/RenderListPlugin
--
TWiki:Main/ThomasWeigert - 15 Aug 2005
to top