Monday, November 30, 2020

What is .rst file reStructured Text

reStructuredText (RST, ReST, or reST) is a file format for textual data used primarily in the Python programming language community for technical documentation.


It is part of the Docutils project of the Python Doc-SIG (Documentation Special Interest Group), aimed at creating a set of tools for Python similar to Javadoc for Java or Plain Old Documentation (POD) for Perl. Docutils can extract comments and information from Python programs, and format them into various forms of program documentation.[1]


In this sense, reStructuredText is a lightweight markup language designed to be both (a) processable by documentation-processing software such as Docutils, and (b) easily readable by human programmers who are reading and writing Python source code.



Examples of reST markup


Headers

Section Header

==============


Subsection Header

-----------------


Lists

- A bullet list item

- Second item


  - A sub item


- Spacing between items separates list items


* Different bullet symbols create separate lists


- Third item


1) An enumerated list item


2) Second item


   a) Sub item that goes on at length and thus needs

      to be wrapped. Note the indentation that must

      match the beginning of the text, not the 

      enumerator.


      i) List items can even include


         paragraph breaks.


3) Third item


#) Another enumerated list item


#) Second item


Images

.. image:: /path/to/image.jpg



Named links

A sentence with links to `Wikipedia`_ and the `Linux kernel archive`_.


.. _Wikipedia: https://www.wikipedia.org/

.. _Linux kernel archive: https://www.kernel.org/



Anonymous links

Another sentence with an `anonymous link to the Python website`__.


__ https://www.python.org/



Literal blocks

::


  some literal text


This may also be used inline at the end of a paragraph, like so::


  some more literal text


.. code:: python


   print("A literal block directive explicitly marked as python code")




References:

https://en.wikipedia.org/wiki/ReStructuredText#:~:text=reStructuredText%20(RST%2C%20ReST%2C%20or,language%20community%20for%20technical%20documentation.

No comments:

Post a Comment