<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>HelpOnParsers/ReStructuredText</title></articleinfo><section><title>What is ReStructured Text?</title><para>ReStructuredText is an easy-to-read, what-you-see-is-what-you-get plaintext markup syntax and parser system. It is useful for in-line program documentation (such as Python docstrings), for quickly creating simple web pages, and for stand-alone documents. ReStructuredText is designed for extensibility for specific application domains. ReStructuredText is a revision and re-interpretation of the StructuredText and Setext lightweight markup systems. </para><para>People new to Wikis often find the ReStructuredText markup more natural and easier to learn than the default markup of <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/MoinMoin#">MoinMoin</ulink>. </para></section><section><title>ReStructuredText Parser</title><section><title>Installation</title><para>Before you can use it, you need to install the Python docutils package, which provides the additional ReStructuredText support that <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/MoinMoin#">MoinMoin</ulink> needs.   </para><para>The docutils version you will need depends on the <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/MoinMoin#">MoinMoin</ulink> version. If you are reading this text here as part of your <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/MoinMoin#">MoinMoin</ulink> installation, you probably have <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/MoinMoin#">MoinMoin</ulink> 1.5 or newer, which currently (as of January 2006) needs docutils 0.4.0 or newer, or a recent 0.3.10 snapshot.  If you are using <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/MoinMoin#">MoinMoin</ulink> on Linux, docutils is probably already available as part of your Linux distribution.  For example on Debian GNU/Linux you simply need to type <code>apt-get install python-docutils</code>.  Other Linux distributions use other means to install packages:  See the documentation of your Linux distribution. </para></section><section><title>The Parser in MoinMoin</title><para>The parser supports the same features that are supported by the docutils HTML writer. However, some aspects have been slightly modified to work well with <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/MoinMoin#">MoinMoin</ulink>. These areas are outlined below. </para></section><section><title>Using ReST in MoinMoin</title><section><title>Example</title>Rendering of reStructured text is not possible, please install Docutils.<!--RAW HTML: Rendering of reStructured text is not possible, please install Docutils.--><screen><![CDATA[This is a *very* simple example. If you see two asterisks around the word "very" in the previous sentence, then the module docutils is improperly installed (or not installed at all). When the module docutils is there, the word is displayed in italics and this whole block of text is not displayed in a special source-code-like format, but like a normal part of the page.]]></screen></section><section><title>Unknown Targets</title><para>Unknown targets are used to create wiki links. Typically an unknown target would cause an error in a reStructuredText document. To enable wiki like behavior, unknown targets now create links to wiki pages using the target name as the name of the wiki page. For example: </para><itemizedlist><listitem override="none"><para>{{{ #!rst </para></listitem></itemizedlist><para>Here is a link to a <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/MoinMoin#">MoinMoin</ulink> page named <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/SecondPage#">SecondPage</ulink>_. }}} </para><itemizedlist><listitem override="none"><para>Rendering of reStructured text is not possible, please install Docutils.</para><!--RAW HTML: Rendering of reStructured text is not possible, please install Docutils.--><screen><![CDATA[ 
Here is a link to a MoinMoin page named SecondPage_.]]></screen></listitem></itemizedlist><para>The above contains a reStructuredText reference to &quot;<ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/SecondPage#">SecondPage</ulink>&quot;. The reference would typically cause an unknown target error from the docutils parser. This is because there isn't a target in the document named &quot;<ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/SecondPage#">SecondPage</ulink>&quot;. However, with the <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/MoinMoin#">MoinMoin</ulink> parser, the &quot;<ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/SecondPage#">SecondPage</ulink>_&quot; reference instead creates a link to a <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/MoinMoin#">MoinMoin</ulink> page named &quot;<ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/SecondPage#">SecondPage</ulink>&quot;. </para></section><section><title>Support for MoinMoin-specific link schemes</title><para><ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/MoinMoin#">MoinMoin</ulink>-specific link schemes are supported when used in a reStructuredText  explicit hyperlink target. For example: </para><itemizedlist><listitem override="none"><para>{{{ #!rst </para></listitem></itemizedlist><para>Here is a link to a page attachment<emphasis role="underline">. <para/> attachment:Attachment.zip }}} <itemizedlist><listitem override="none"><para>Rendering of reStructured text is not possible, please install Docutils.</para><!--RAW HTML: Rendering of reStructured text is not possible, please install Docutils.--><screen><![CDATA[Here is a link to a page attachment__.
]]><![CDATA[
__ attachment:Attachment.zip]]></screen></listitem></itemizedlist><para>The above creates a link to an attachment named Attachment.zip. If the attachment for the page does not exist, the link text will be replaced with the typical <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/MoinMoin#">MoinMoin</ulink> replacement text for uploading an attachment. Supported <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/MoinMoin#">MoinMoin</ulink>-specific link schemes are: </para><itemizedlist><listitem><para><code>wiki:</code> </para></listitem><listitem><para><code>attachment:</code> </para></listitem><listitem><para><code>inline:</code> </para></listitem><listitem><para><code>drawing:</code> </para></listitem></itemizedlist></emphasis></para></section><section><title>Inline Images</title><para>Docutils image directives, that are not urls, are converted to <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/MoinMoin#">MoinMoin</ulink> <code>inline:</code> links. This produces the expected behavior of inserting the image into the document. If the image attachment does not exist, the typical <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/MoinMoin#">MoinMoin</ulink> upload new attachment message will be displayed instead. For example: </para><itemizedlist><listitem override="none"><para>{{{ #!rst </para></listitem></itemizedlist><para>Here is the picture I took yesterday |image| </para><para>.. |image| image:: Yesterday.jpg }}} </para><itemizedlist><listitem override="none"><para>Rendering of reStructured text is not possible, please install Docutils.</para><!--RAW HTML: Rendering of reStructured text is not possible, please install Docutils.--><screen><![CDATA[Here is the picture I took yesterday |image|
]]><![CDATA[
.. |image| image:: Yesterday.jpg]]></screen></listitem></itemizedlist><para>The above will insert the image &quot;Yesterday.jpg&quot; in place of <code>|image|</code>. </para></section><section><title>Experimental Features</title><para>The include and macro directives are considered experimental due to lack of testing. They are expected to work but have not been used extensively. </para><section><title>Include Support</title><para>The reStructuredText include directive is supported with some restrictions. The directive allows including wiki pages from the same wiki (page attachments are not candidates for the include directive). Included pages must be formatted using reStructuredText (wiki formatted pages will produce improperly formatted documents). For example, the following would insert the pages header and footer surrounding the page contents. </para><itemizedlist><listitem override="none"><para>{{{ #!rst </para></listitem></itemizedlist><para>.. include:: header </para><para>The sole document sentence. </para><para>.. include:: footer }}} </para><para>The number of included documents is limited to ten. This is to prevent denial of service attacks using recursive include directives. </para></section><section><title>Macro Support</title><para>The <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/MoinMoin#">MoinMoin</ulink> reStructuredText parser adds a new <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/MoinMoin#">MoinMoin</ulink> specific macro directive. The directive allows access to <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/MoinMoin#">MoinMoin</ulink> macros from within a reStructuredText document. For example: </para><itemizedlist><listitem override="none"><para>{{{ #!rst </para></listitem></itemizedlist><para>Use the title search macro to insert a search box to search through page titles. </para><para>.. macro:: <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/TitleSearch#">TitleSearch</ulink> }}} </para><itemizedlist><listitem override="none"><para>Rendering of reStructured text is not possible, please install Docutils.</para><!--RAW HTML: Rendering of reStructured text is not possible, please install Docutils.--><screen><![CDATA[Use the title search macro to insert a search box to search through page titles.
]]><![CDATA[
.. macro:: [[TitleSearch]]]]></screen></listitem></itemizedlist></section></section><section><title>Known Issues</title><itemizedlist><listitem><para>Docutils and <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/MoinMoin#">MoinMoin</ulink> use different sets of css directives. Some directives overlap, while others do not. For example, the note directive is not displayed with any special formatting. This issue is most severe when using the rightsidebar theme with the docutils sidebar directive. The docutils sidebar will replace the <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/MoinMoin#">MoinMoin</ulink> sidebar. It is currently recommended that the sidebar directive not be used with <ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/MoinMoin#">MoinMoin</ulink>. </para></listitem><listitem><para>Features related to external URL and local file retrieval are unsupported by the parser in order to guarantee local security. Besides that, raw roles and other features that might support the user to output raw HTML are disallowed, too. </para></listitem></itemizedlist></section><section><title>Links</title><itemizedlist><listitem><para><ulink url="http://docutils.sourceforge.net/rst.html">reStructuredText</ulink> </para></listitem><listitem><para><ulink url="http://docutils.sourceforge.net/docs/user/rst/quickref.html">Quick Reference</ulink> </para></listitem><listitem><para><ulink url="http://docutils.sourceforge.net/">Docutils</ulink> </para></listitem><listitem><para><ulink url="https://wiki.hcoop.net/HelpOnParsers/ReStructuredText/HelpOnParsers/ReStructuredText/RstPrimer#">A ReStructuredText Primer</ulink> </para></listitem></itemizedlist></section></section></section></article>