reStructuredText is a lightweight markup language intended to be highly readable in source format.
Questions tagged [restructuredtext]
1265 questions
34
votes
10 answers
How do you get Python documentation in Texinfo Info format?
Since Python 2.6, it seems the documentation is in the new reStructuredText format, and it doesn't seem very easy to build a Texinfo Info file out of the box anymore.
I'm an Emacs addict and prefer my documentation installed in Info.
Does anyone…

Matt Curtis
- 23,168
- 8
- 60
- 63
32
votes
5 answers
How can I make a non-breaking space in reStructuredText?
How can I make a non-breaking space in reStructuredText?
An obvious but problematic solution is:
`word A`
But it might be treated differently by different implementations, such as rst2latex or rst2pdf. Plus it is rendered in italics.

Davoud Taghawi-Nejad
- 16,142
- 12
- 62
- 82
30
votes
2 answers
How to underline text in reStructuredText?
Of course, on the web an underline denotes hyperlink, but what if I need underline which is not a hyperlink?

Alex Bolotov
- 8,781
- 9
- 53
- 57
30
votes
2 answers
Substitutions inside Sphinx code blocks aren't replaced
In this reST example meant to be rendered by Sphinx, |yaco_url| doesn't get replaced because it's in a code-block:
.. |yaco_url| replace:: http://yaco.es/
You can use wget to download it:
.. code-block:: console
$ wget…

Danny Navarro
- 2,733
- 1
- 18
- 22
30
votes
7 answers
How to use Python to programmatically generate part of Sphinx documentation?
I am using Sphinx to generate the documentation for a project of mine.
In this project, I describe a list of available commands in a yaml file which, once loaded, results in a dictionary in the form {command-name : command-description} for…

mac
- 42,153
- 26
- 121
- 131
29
votes
5 answers
sphinx, restructuredtext: set color for a single word
Is there a way to set the color of single words (or characters) in sphinx? I'm pretty sure there should be some markup tag, like HTML's font tag.

Adam Matan
- 128,757
- 147
- 397
- 562
28
votes
2 answers
How do I create a global role/roles in Sphinx?
This is a followup of "ReST Strikethrough" ReST strikethrough but in a Sphinx rather than ReST context. My question is whether there is a central place in sphinx where to put a "role" directive or whether this directive really has to be repeated in…

Bud P. Bruegger
- 1,021
- 10
- 15
28
votes
1 answer
Source Code in Bullet Lists with reStructuredText
I am trying to include source code in bullet lists with reStructuredText; like this:
- List item 1 ::
code sample...
code sample...
- List item 2 ::
code sample...
code sample...
However, I get the following warning:
System Message:…

ustun
- 6,941
- 5
- 44
- 57
28
votes
2 answers
How do I break a link in a rst docstring to satisfy pep8?
I'm using Sphinxdoc to generate api documentation, and I've run into a problem with pep8 conformance when writing a docstring.
As you can see below, the link to the OWASP site ends at column 105, far past what pep8 dictates maximum-line-length
def…

thebjorn
- 26,297
- 11
- 96
- 138
27
votes
2 answers
Is there a Sphinx reST Python docstring field for yields?
I'm trying to use reST-style docstrings, i.e.
def foo(bar):
"""a method that takes a bar
:param bar: a Bar instance
:type bar: Bar
Is there a standard way to document yields? I looked at…

gatoatigrado
- 16,580
- 18
- 81
- 143
27
votes
4 answers
How to parse restructuredtext in python?
Is there any module that can parse restructuredtext into a tree model?
Can docutils or sphinx do this?

zhangailin
- 926
- 2
- 10
- 20
26
votes
3 answers
Multi-line table cell in reStructuredText?
Is there a way to input a newline into a table cell? For example, say I have a table like this:
+==========+==========+==========+
+ Header 1 + Header 2 + Header 3 +
+==========+==========+==========+
+ Item 1 + + +
+ Item 2 + …

Kiet Tran
- 1,458
- 2
- 13
- 22
24
votes
4 answers
Insert a link into bold text in reStructuredText
I try to insert a link into bold text in reStructuredText but failed.
This is my rst source:
**Lorem ipsum dolor sit amet, `consectetur `_
adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore
magna…

Zeyi Fan
- 2,213
- 3
- 17
- 19
24
votes
2 answers
In reStructuredText, how to put an inline literal inside of a hyperlink?
In my reStructuredText document, I have a section defined like so:
Update the ``PATH`` Environment Variable
----------------------------------------
I would like to link to this section like so:
* `Update the ``PATH`` Environment Variable`_
But,…

davidrmcharles
- 1,923
- 2
- 20
- 33
24
votes
3 answers
A literal "*" in RestructuredText
I am looking at this snippet of code:
def ook(*args):
"""Some silly function.
:param *args: Optional arguments.
"""
...
And as soon as I run Sphinx, I get the oh-so helpful error:
WARNING: Inline literal start-string without…

Sardathrion - against SE abuse
- 17,269
- 27
- 101
- 156