reStructuredText is a lightweight markup language intended to be highly readable in source format.
Questions tagged [restructuredtext]
1265 questions
13
votes
1 answer
How to insert metadata in Sphinx?
I want to insert some metadata (i.e. keywords, description, author) inside my web pages created by Sphinx.
I found
:fieldname: Field content
in the documentation of Sphinx, but I have no idea how to use it.

xxks-kkk
- 2,336
- 3
- 28
- 48
13
votes
1 answer
Can't get sphinx to link under toctree to another document
I'm attempting to learn sphinx and am stuck on just the basic examples. I'm being given the following error on a make html in the source directory.
Running Sphinx v1.1.3
loading pickled environment... not yet created
building [html]: targets for 2…

John Lotacs
- 1,184
- 4
- 20
- 34
12
votes
1 answer
Vertical headers in RestructuredText tables
In RestructuredText, you can render a header row in a table like this (taken from the documentation :
+------------------------+------------+----------+----------+
| Header row, column 1 | Header 2 | Header 3 | Header 4 |
| (header rows…

gozzilli
- 8,089
- 11
- 56
- 87
12
votes
3 answers
How to ensure that README.rst is valid?
There are two version of my little tool:
https://pypi.python.org/pypi/tbzuploader/2017.11.0
https://pypi.python.org/pypi/tbzuploader/2017.12.0 Bug: The pypi page looks ugly.
In the last update a change in README.rst cases a warning:
user@host>…

guettli
- 25,042
- 81
- 346
- 663
12
votes
1 answer
What's the difference between the code and code-block directives in ReST?
In every renderer I've tried, code and code-block seem to have the exact same result: a block of code. Both generate the exact same html -- including classes and tag kind (using I think it was docutils?):
potato
- 357
- 1
- 14
12
votes
1 answer
How to make toctree link refer to the separate file like it refers to the subsections
Structure
The following structure of the project:
index.rst
MyProject
=========
Contents:
.. toctree::
group1
group1.rst
Group1
------
Subgroup1
=========
Subgroup1 contents
Subgroup2
=========
Subgroup2 contents
Rendered to (after…
user2288008
12
votes
1 answer
Different toctree title and document title, specified in document source only
When inserting a document in a toctree, the link displayed is the main title of the document. So when I do:
.. toctree::
materials/diffuse
materials/glossy
materials/specular
I get:
Materials
Diffuse material
Glossy material
Specular…

galinette
- 8,896
- 2
- 36
- 87
12
votes
3 answers
Sphinx: Correct way to document an enum?
Looking through the C and C++ domains of Sphinx, it doesn't appear to have native support for documenting enums (and much less anonymous enums). As of now, I use cpp:type:: for the enum type, and then a list of all possible values and their…

JustSid
- 25,168
- 7
- 79
- 97
12
votes
2 answers
In reStructuredText, how do I use emphasis and superscript at the same time?
The following piece of reStructuredText does not give the result I expect.
*:sup:`superscript`*
Expected result: superscript
Actual result: :sup:`superscript`
The reason why it is happening is clear (reST text roles cannot be nested), however how…

Andrea Corbellini
- 17,339
- 3
- 53
- 69
12
votes
2 answers
How do I prevent sphinx from making a url a hyperlink?
In my docs, I occasionally use "garbage" urls as examples and don't want them to be hyperlinks to nowhere. Is there any syntax to make these urls not hyperlinks?

UsAaR33
- 3,536
- 2
- 34
- 55
11
votes
3 answers
How to force whitespace in code block in reStructuredText
In RST, we use some whitespaces in front of a block to say this is a code block. Because Python also uses whitespace to indent a code block, I would like my RST code block to preserve those whitespaces if I were writing Python code. How can I do…

Nam Nguyen
- 1,765
- 9
- 13
11
votes
2 answers
Creating a literal text block in Sphinx
I would like to make a directory tree in a docstring and have it rendered without change to my Sphinx documentation, but I am having trouble. I have tried using: single, double, and triple back-ticks; literal :code:; and literal .. code-block::…

HFBrowning
- 2,196
- 3
- 23
- 42
11
votes
2 answers
Macro or equivalent in reStructuredText?
I have a
Is there any macro or…

prosseek
- 182,215
- 215
- 566
- 871
11
votes
2 answers
How to include space in a hyperlink target using reStructuredText?
I can do this:
For more info, see Target_.
.. _Target: http://google.com
This correctly generates documentation that links Target to "http://google.com".
I want to replace Target with text that has spaces:
For more info, see Text With Space_.
..…

mpenkov
- 21,621
- 10
- 84
- 126
11
votes
2 answers
Sphinx is not recognising my markdown tables
I am using sphinx locally with .md files. When I add a table in the format:
| something | something else | something more |
| one | two | three |
the text is getting parsed as a paragraph.
I have tried with rst files and it works in this…

Byte_Monster
- 313
- 3
- 14