ReStructuredTextPlugin
Render reStructuredText (Python documentation) within a TWiki page
Introduction
This plugin allows processing of reStructuredText input within a TWiki page. It accomplishes this task by calling the
trip reStructuredText parser. The
trip utility is included with this plugin; it is a Perl implementation of a reStructuredText parser (and writers).
reStructuredText
is an easy-to-read, what-you-see-is-what-you-get plain-text markup syntax and parser system. It is useful for inline program documentation (such as Python docstrings), for quickly creating simple web pages, and for standalone documents. The original implementation of a reStructuredText parser is that of the docutils project, written in Python. The "trip" name is an acronym for
Transforming
reStructuredText
in
Perl".
Syntax Rules
%RESTSTART{ _parms_ }%
Add reStructuredText here
%RESTEND%=
The
parms are optional. Supported parameters:
-
options="<trip options>" : A set of options to be passed to the trip executable.
-
stylesheet="<url>" : Uses url as URL for a stylesheet.
Examples
%RESTSTART%
A reStructuredText Header
=========================
This is reStructuredText. Here I have a **bold block
with *italics* and ``literal`` nested within it**.
It has link to `Another Header`_.
Another Header
==============
This is a second section.
%RESTEND%
%RESTSTART%
A reStructuredText Header
=====================
This is reStructuredText. Here I have a **bold block
with
italics and ``literal`` nested within it**.
It has link to `Another Header`_.
Another Header
==========
This is a second section.
%RESTEND%
(End of Examples)
Plugin Settings
Plugin settings are stored as preferences variables. To reference a plugin setting write
%<plugin>_<setting>%, i.e.
%RESTRUCTUREDTEXTPLUGIN_SHORTDESCRIPTION%
- One line description, shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = Render reStructuredText (Python documentation) within a TWiki page
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
ReStructuredTextPlugin.zip in your twiki installation directory. Content: | File: | Description: |
data/TWiki/ReStructuredTextPlugin.txt | Plugin topic |
lib/TWiki/Plugins/ReStructuredTextPlugin.pm | Plugin Perl module |
lib/TWiki/Plugins/ReStructuredTextPlugin/Config.spec | Settings for configure script |
lib/TWiki/Plugins/ReStructuredTextPlugin/trip/* | trip utility (Perl script) |
- Visit
configure in your TWiki installation:
- Enable the plugin in the {Plugins} section
- In Extensions section, set {Plugins}{ReStructuredTextPlugin}{TripCmd} to an absolute path; the trip executable is located below your TWiki directory at
lib/TWiki/Plugins/ReStructuredTextPlugin/trip/bin/trip.
- Test above example if the installation was successful.
Plugin Info
Related Topics: TWikiPreferences,
TWikiPlugins