Home > Developers > Wiki > HelpPage
Views

Restructured Text

The following will serve as a quick start guide to editing with reStructured Text (reST), an easy-to-read, what-you-see-is-what-you-get plaintext markup syntax and parser system. For more detailed information please see the quick reStructuredText documentation written by David Goodger.


Inline Markup

Plain Text Desired Result Notes
*italics* italics Single asterisks surrounding text
**bold** bold Double asterisks surrounding text
``inline monospace`` inline monospace Double backticks surrounding text

Linking

Type Plain Text Result
Existing WikiPage KnownIssues or [Known Issues] KnownIssues or Known Issues
New WikiPage NewPage or [New Page] NewPage? or [New Page]?
Labelled Link `Take a look at Known Issues <KnownIssues>`_ Take a look at Known Issues
Internal Link `Mifos Product Roadmap </developers/roadmap>`_ Mifos Product Roadmap
External Link `Grameen Foundation <http://www.grameenfoundation.org>`_ Grameen Foundation
Unlabelled hyperlink http://www.mifos.org http://www.mifos.org
Escaping from autolink !NotaWikiPage !NotaWikiPage

Lists

For both bulleted (*, -, +) and numbered lists (1. a.) there must be a space after the symbol. In addition there must be a blank line before and after the bulleted text

Bulleted Lists

Look at these bullets

* First bullet
* Second bullet

  * First sub-bullet
  * Second sub-bullet

produces

Look at these bullets

  • First bullet
  • Second bullet
    • First sub-bullet
    • Second sub-bullet

Note that a newline between indentation levels as well as two spaces of indentation are required for the wiki formatter to properly format bulleted lists.

Numbered Lists

#. Top level
#. Second level

  #. Top sub-level
  #. Second sub-level

#. Numbering re-starts here

produces

  1. Top level
  2. Second level
  1. Top sub-level
  2. Second sub-level
  1. Numbering re-starts here

A more intuitive sub-level numbering might be a., b., c., etc., but this does not seem to work. Also unclear is why numbering restarts when resuming the initial level of indentation.


Miscellaneous

Literal Blocks

To produce blocks of code, type a paragraph containing only colons (::). All text that is indented below the colons will be formatted as monospace text with markup and whitespace preserved. The literal block ends once text returns to the preceding paragraph's indentation, as shown by the following:

This is a normal paragraph.  Down below it will be a block of code.

::

  This text should be *preserved* with
   all spacing and white space.

    It is useful for entering blocks
         of code.

We're back to normal formatting now. Wow that was a nice block of code!

produces:

This is a normal paragraph. Down below it will be a block of code.

This text should be preserved with
 all spacing and white space.

  It is useful for entering blocks
       of code.

We're back to normal formatting now. Wow that was a nice block of code!

Line Breaks

Useful for formatting addresses and the such:

| Grameen Technology Center
| 909 NE Boat Street, Suite 300
| Seattle, WA 98105

produces

Grameen Technology Center
909 NE Boat Street, Suite 300
Seattle, WA 98105

Horizontal Rule

A string of four consecutive symbols (-), (+), (*), (~) will produce a horizontal line to divide sections of text.

----

produces:


Creating Tables

There are a number of ways to create tables within reStructured Text, the simplest and suggested one to use is the list-table directive. All four methods are displayed below:

list-tables

.. list-table:: Sample table
   :widths: 10 50
   :header-rows: 1

   * - Row #
     - Description
   * - Row 1
     - Here is a long row.
   * - Row 2
     - Here is another long row.
   * - Row 3
     - Each new row is started with an '*', each new column with a '-'.
   * - Row 4
     - By adjusting the width initially I can control the length of each row.

produces

Sample table
Row # Description
Row 1 Here is a long row.
Row 2 Here is another long row.
Row 3 Each new row is started with an '*', each new column with a '-'.
Row 4 By adjusting the width initially I can control the length of each row.

csv-tables

These are simple tables (cell cannot span across multiple rows) yet are easier to create than the formats below.

.. csv-table:: Table Name
   :header: "Column One", "Column Two", "Column Three"
   :widths: 20, 10, 30

   "Text goes here", 15.85, "Enter it now!"
   "interesting row", 21.47, "indeed."
   "Look an empty cell", 19.34, " "

produces

Table Name
Column One Column Two Column Three
Text goes here 15.85 Enter it now!
interesting row 21.47 indeed.
Look! an empty cell 19.34  

Further information on the csv-table and other directives within reStructured Text can be found here

Complex but Clunky Tables

+------------+------------+-----------+
| Header 1   | Header 2   | Header 3  |
+============+============+===========+
| body row 1 | column 2   | column 3  |
+------------+------------+-----------+
| body row 2 | Cells may span columns.|
+------------+------------+-----------+
| body row 3 | Cells may  | - Cells   |
+------------+ span rows. | - contain |
| body row 4 |            | - blocks. |
+------------+------------+-----------+

produces:

Header 1 Header 2 Header 3
body row 1 column 2 column 3
body row 2 Cells may span columns.
body row 3 Cells may span rows.
  • Cells
  • contain
  • blocks.
body row 4

Simple but limited tables

=====  =====  ======
   Inputs     Output
------------  ------
  A      B    A or B
=====  =====  ======
False  False  False
True   False  True
False  True   True
True   True   True
=====  =====  ======

produces:

Inputs Output
A B A or B
False False False
True False True
False True True
True True True

Sections/Headers

Sections/Headers are created by underlining the text completely with a string of the following characters =, +, -, ~.

Top Level
=========

Second Level
++++++++++++

Third Level
-----------

Fourth Level
~~~~~~~~~~~~

Table of Contents

  • These Sections/Headers are implicit targets (anchors) so to link to a Section you would simply type, `Inline Markup`_ to produce a link the Inline Markup section at the top of this page:
  • A Table of Contents can also be auto-generated from these Sections/Headers using the following directive at the top of the page (above all headers):

.. Contents::

  • To rename the table of contents you would type the following:

.. Contents:: Named Table of Contents

  • To select how many levels deep you want the Table of Contents to display, you would enter the following (in this example 2 levels deep):
.. Contents::
  :depth: 2

Auto-Section Numbering

To generate sections and sub-sections that are autonumbered (1, 1.1, 1.1.1) you can use the sectnum directive.

At the top of the page type ".. sectnum::" and your sections will be auto-numbered in the manner described above.

For an example of auto-numbered sections, please look here.


Inserting Files and Images

Please refer to the following documentation for using images and files on wiki pages


subtopics:


Grameen logo