请输入您要查询的百科知识:

 

词条 ReStructuredText
释义

  1. History

  2. Reference implementation

  3. Applications

  4. Examples of reST markup

      Headers    Lists    Images    Named links    Anonymous links    Literal blocks  

  5. See also

  6. References

  7. External links

{{distinguish|Representational state transfer}}{{Infobox file format
| name = reStructuredText
| logo =
| icon =
| iconcaption =
| screenshot =
| caption =
| extension = .rst
| mime =
| type code =
| uniform type =
| conforms to =
| magic =
| owner = David Goodger
| released = {{Start date and age|2002|04|02}}
| latest release version = Revision 7942
| latest release date = {{Start date and age|2016|05|25}}
| genre =
| container for =
| contained by =
| extended from =
| extended to =
| standard =
| free = Public domain
| url = {{URL|https://docutils.readthedocs.io/en/sphinx-docs/user/rst/quickstart.html}}
}}

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.

History

There were a number of problems with the earlier lightweight markup language StructuredText (developed by Zope), and reST was developed to address them.[2] The name reStructuredText was chosen to indicate that reST is a "revised, reworked, and reinterpreted StructuredText."[3]

reST began to see significant use in the Python community in 2002.{{cn|date=June 2016}}

Reference implementation

The reference implementation of the reST parser is a component of the Docutils text processing framework in the Python programming language, but other parsers are available.

There is no official mime type registered for ReStructured Text, but the unofficial one is ``text/x-rst``[4] .

Applications

reStructuredText is commonly used for technical documentation, for example, in documentation of Python libraries.[5] However, it is suitable for a wide range of texts.

Since 2008, reST has been a core component of Python's Sphinx document generation system.

Trac also supports reStructuredText,[6] as do GitHub and Bitbucket.

In 2011, Distributed Proofreaders, which prepared texts for Project Gutenberg, was considering adoption of reST as a basic format from which other ebook formats could be generated.[7]{{update inline|date=May 2015}}

In July 2016 the Linux kernel project decided to transition from DocBook based documentation to reStructuredText and the Sphinx toolchain.[8]

The software build tool CMake switched from a custom markup language to reStructuredText in version 3.0 for its documentation.[9]

Examples of reST markup

Headers

 Section Header ==============  Subsection Header -----------------

Lists

- A bullet list item- Second item- Spacing between items creates 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.

3) Third item

  1. ) Another enumerated list item
  1. ) 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/

N.B.: named links and anonymous links are enclosed in grave accents (`), and not in apostrophes (').

Literal blocks

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

.. code:: python

See also

  • Comparison of document markup languages
  • Comparison of documentation generators
  • Comparison of notetaking software

References

1. ^{{cite web | last = Mertz | first = David | title = XML Matters: reStructuredText | publisher = IBM developerWorks | date = 2003-02-01 | url = https://www.ibm.com/developerworks/library/x-matters24/ | accessdate = 2016-10-05 }}
2. ^{{cite web | last = Goodger | first = David | title = reStructuredText: Markup Syntax and Parser Component of Docutils | publisher = Docutils Project | date = 2016-05-24 | url = https://docutils.readthedocs.io/en/sphinx-docs/dev/rst/problems.html | accessdate = 2016-10-05 }}
3. ^{{cite web | last = Goodger | first = David | title = Docutils FAQ (Frequently Asked Questions) | publisher = Docutils Project | date = 2016-02-26 | url = http://docutils.sourceforge.net/FAQ.html#why-is-it-called-restructuredtext | accessdate = 2016-10-05 }}
4. ^{{cite web | title = What's the official MIME type for reStructuredText data? in Docutils FAQ. | publisher = Docutils Project | url = http://docutils.sourceforge.net/FAQ.html#what-s-the-official-mime-type-for-restructuredtext-data | accessdate = 2017-12-20 }}
5. ^{{cite web| last=Goodger| first=David| title=PEP 287 -- reStructuredText Docstring Format| date=2002-04-02| url=https://www.python.org/dev/peps/pep-0287/| publisher=Python Software Foundation| accessdate=2016-10-05}}
6. ^{{cite web| url=https://trac.edgewall.org/wiki/WikiRestructuredText| title=reStructuredText Support in Trac| date=2016-09-13| publisher=Trac| accessdate=2016-10-05}}
7. ^{{cite web | last = Newby | first = Greg | title = Minutes of 2010 December 11 meeting | publisher = Distributed Proofreaders | date = 2011-01-08 | url = http://www.pgdp.net/phpBB2/viewtopic.php?t=44456 | registration=yes | accessdate = 2011-01-08 }}
8. ^{{cite web | title = Kernel documentation with Sphinx, part 1: how we got here | publisher = LWN.net | date = 2016-07-06 | url = http://lwn.net/Articles/692704/ | accessdate = 2016-10-27 }}
9. ^{{cite web | title = CMake 3.0.0 Release Notes | publisher = Kitware, Inc. | date = 2014-06-10 | url = https://cmake.org/cmake/help/v3.0/release/3.0.0.html | accessdate = 2016-10-05 }}

External links

  • Official reStructuredText website with reference pages
{{lowercase|reStructuredText}}{{Document markup languages}}

1 : Lightweight markup languages

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/20 14:39:22