You are here: TWiki> Plugins Web>ReStructuredTextPlugin (2007-04-09, SteveRJones)
Tags:
rendering1Add my vote for this tag create new tag
, view all tags

ReStructuredTextPlugin

This plugin allows processing of reStructuredText input within a TWiki page. It accomplishes this task by calling the trip reStructuredText parser. trip is a Perl implementation of a reStructuredText parser (and writers).

reStructuredText is an easy-to-read, what-you-see-is-what-you-get plaintext 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}%
  • %RESTEND%

The parms that are processed are:

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**.

Another Header
==============

This is a second section.
%RESTEND%

It produces the following output:

%RESTSTART% A reStructuredText Header =====================

This is reStructuredText. Here I have a **bold block with italics and ``literal`` nested within it**.

Another Header ==========

This is a second section. %RESTEND%

Plugin 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 = Render reStructuredText (Python documentation) within a TWiki page

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

  • Set TRIP to give a different path to the trip executable.
    • Set TRIP = /usr/bin/trip

  • Set TRIPOPTIONS to specify default options to trip.
    • Set TRIPOPTIONS = -D source_link=0 -D time=0 -D

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
data/TWiki/ReStructuredTextPlugin.txt,v Plugin topic repository
lib/TWiki/Plugins/ReStructuredTextPlugin.pm Plugin Perl module
lib/TWiki/Plugins/ReStructuredTextPlugin/fs-trip-twiki-/1.4.3/all/bin/trip Perl module

  • You might want to modify the location of the Perl program trip; See the TRIP option above
  • The trip Perl program points to a specific Perl path; You will definitely want to modify that.
  • Test if the installation was successful:
    • enter samples here

Plugin Info

Plugin Author: TWiki:Main.SteveRJones
Plugin Version: 19 May 2005 (V1.000)
Change History:  
19 May 2005: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.024
CPAN Dependencies: none
Other Dependencies: trip
Perl Version: 5.005
License: GPL (GNU General Public License)
TWiki:Plugins/Benchmark: GoodStyle nn%, FormattedSearch nn%, ReStructuredTextPlugin nn%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/ReStructuredTextPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/ReStructuredTextPluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/ReStructuredTextPluginAppraisal

Related Topics: TWikiPreferences, TWikiPlugins

-- TWiki:Main.SteveRJones - 19 May 2005

Topic revision: r4 - 2007-04-09 - 14:15:19 - SteveRJones
 
TWIKI.NET
This site is powered by the TWiki collaboration platform
Ideas, requests, problems regarding TWiki? Send feedback
Copyright © 1999-2009 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.