Tags:
rendering1Add my vote for this tag create new tag
, view all tags

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

Unrendered, we look like:

%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%

With the plugin installed correctly, we look like

%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

Plugin Author: TWiki:Main.SteveRJones, TWiki:Main.PeterThoeny
Plugin Copyright: © 2005 TWiki:Main.SteveRJones
© 2010 TWiki:Main.PeterThoeny
© 2005-2010 TWiki:TWiki.TWikiContributor
Trip tool Author: TWiki:Main.MarkNodine
Trip tool Copyright: © 2002-2005 Freescale Semiconductor
License: GPL (GNU General Public License)
Plugin Version: 2011-05-14 (V1.2)
Change History:  
2011-05-14: TWikibug:Item6701: Doc improvements; small fix in Config.spec -- TWiki:Main.PeterThoeny
2010-12-16: TWikibug:Item6530: Move plugin settings to configure (to fix security issue); filter options parameter (to fix security issue) -- TWiki:Main.PeterThoeny
2010-12-15: TWikibug:Item6530: Doc improvements; changing TWIKIWEB to SYSTEMWEB -- TWiki:Main.PeterThoeny
2005-05-19: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.024
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
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

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatmd5 ReStructuredTextPlugin.md5 r2 r1 manage 0.2 K 2011-05-15 - 06:19 PeterThoeny  
Compressed Zip archivetgz ReStructuredTextPlugin.tgz r2 r1 manage 248.1 K 2011-05-15 - 06:18 PeterThoeny  
Compressed Zip archivezip ReStructuredTextPlugin.zip r3 r2 r1 manage 280.1 K 2011-05-15 - 06:18 PeterThoeny  
Unknown file formatEXT ReStructuredTextPlugin_installer r1 manage 5.7 K 2011-05-15 - 06:19 PeterThoeny  
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2013-10-16 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2016 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.