Skip to content

Sphinx restructure text by example

Espen Angell Kristiansen edited this page Feb 15, 2015 · 2 revisions

Paragraphs and inline formatting

A normal paragraph with **bold** and *italic* text.

Another paragraph, this one `has a  link <http://example.com`_.

Heading structure

You should use the following heading structure:

##############
Document title
##############
Lorem ipsum dolor sit amet, consectetur adipiscing elit.

*******************
First level heading
*******************
Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Second level heading
====================
Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Third level heading
-------------------
Lorem ipsum dolor sit amet, consectetur adipiscing elit.

NOTE: This heading structure is not used for all our docs yet, but should be used for all new documentation.

Linking to other documents

I want to link to gettingstarted.rst from our guide named myguide.rst in the same directory as gettingstarted.rst:

For information about how to get started, see :doc:`gettingsarted`.

If we are in a subdirectory of the one containing gettingstarted.rst, we would need to use POSIX-style relative paths:

For information about how to get started, see :doc:`../gettingsarted`.

If we want to customize the link text instead of using the page header of the getting started guide:

For information about how to get started, see :doc:`this guide <gettingsarted>`.

Warning and note boxes

We can show NOTE and WARNING messages like this::

.. note::

    This is a note.
    
    It can span multiple lines, and it _can use formatting_.
    
.. warning::

    This is a warning.
Clone this wiki locally