Questions tagged [restructuredtext]

reStructuredText is a lightweight markup language intended to be highly readable in source format.

1265 questions
177
votes
2 answers

Inline code highlighting in reStructuredText

I know reStructuredText has this directive: .. code:: bash gedit pohl.m which renders a code block. Is there some way to get syntax highlighting for inline snippets like this: Do edit the file, type ``gedit pohl.m`` into a terminal. The…
Martin Ueding
  • 8,245
  • 6
  • 46
  • 92
145
votes
6 answers

Adding a cross-reference to a subheading or anchor in another page

How to insert a cross-reference in a reST/Sphinx page to either a sub-header or anchor in another page in the same documentation set?
Sue Walsh
  • 1,453
  • 2
  • 10
  • 6
129
votes
8 answers

Have the same README both in Markdown and reStructuredText

I have a project hosted on GitHub. For this I have written my README using the Markdown syntax in order to have it nicely formatted on GitHub. As my project is in Python I also plan to upload it to PyPi. The syntax used for READMEs on PyPi is…
jlengrand
  • 12,152
  • 14
  • 57
  • 87
128
votes
1 answer

reStructuredText tool support

I am a great fan of reStructuredText, however the tools that support it are scattered all over the Internet. The official tool list is incomplete and/or outdated, and can be updated only via commit privileges. For some time there was a comprehensive…
Chen Levy
  • 15,438
  • 17
  • 74
  • 92
114
votes
2 answers

How to create a nested list in reStructuredText?

I am trying to create a properly nested list using the following code (following Sphinx and docutils docs): 1. X a. U b. V c. W 2. Y 3. Z I expect this to result in two OLs but I get the following output instead:
muhuk
  • 15,777
  • 9
  • 59
  • 98
98
votes
4 answers

Format text in a link in reStructuredText

How do you format text within a denoted link in reStructuredText? Specifically, I wish to generate the following HTML from my rst: optparse.OptionParser documentation…
gotgenes
  • 38,661
  • 28
  • 100
  • 128
96
votes
3 answers

How to have same text in two links with restructured text?

Here is what I would like to do: 1. `link `__ 2. `link `__ To obtain:
  1. link
  2. link
The context is a list…
luispedro
  • 6,934
  • 4
  • 35
  • 45
94
votes
6 answers

How to comment a string in restructured text?

The comment of HTML is , how can I make this comment block with restructured text? In order words, how can I comment out some of the lines in restructured text?
prosseek
  • 182,215
  • 215
  • 566
  • 871
93
votes
8 answers

How to document a module constant in Python?

I have a module, errors.py in which several global constants are defined (note: I understand that Python doesn't have constants, but I've defined them by convention using UPPERCASE). """Indicates some unknown error.""" API_ERROR = 1 """Indicates…
skyler
  • 8,010
  • 15
  • 46
  • 69
89
votes
5 answers

Compare and contrast the lightweight markup languages

Please identify the most popular lightweight markup languages and compare their strengths and weaknesses. These languages should be general-purpose markup for technical prose, such as for documentation (for example, Haml doesn't count). See also:…
JasonSmith
  • 72,674
  • 22
  • 123
  • 149
86
votes
4 answers

WARNING: document isn't included in any toctree for included file

I'm getting the warning: WARNING: document isn't included in any toctree for files that exist in the document because they've been explicitly included. So I have the index file: .. toctree:: :maxdepth: 2 pages/0010-foo …
NickChase
  • 1,442
  • 3
  • 15
  • 23
84
votes
11 answers

Math in reStructuredText with LaTeX

I would like to use a lightweight markup language to take notes in my college classes. My editor of choice is gedit, and I found reStructuredText Tools for Gedit, which will run the reStructuredText processor and render the HTML in a pane in gedit.…
Craig Younkins
  • 1,360
  • 2
  • 11
  • 18
82
votes
2 answers

How would I cross-reference a function generated by autodoc in Sphinx?

I am using the Sphinx autodoc feature to generate documentation based on the docstrings of my Python library. The syntax for cross referencing is found here A label must precede the section in order to allow that section to be referenced from other…
Matthew Stamy
  • 1,114
  • 1
  • 7
  • 9
80
votes
8 answers

How can I link/reference another reST file in the documentation?

I have simply no idea on how can I link to another document in the reST file. I want to link a file named install.rst to my quickstart guide in a paragraph. I don't know how can I achieve this. Please can you also refer to a great resource from…
Aditya ultra
  • 942
  • 1
  • 8
  • 15
77
votes
8 answers

How to make PyPi description Markdown work?

I uploaded a package to PyPi using: python setup.py register -r pypi python setup.py sdist upload -r pypi I'm trying to modify the description, I wrote (please don't edit the formatting of the following piece of code, I made it on purpose to…
Maroun
  • 94,125
  • 30
  • 188
  • 241
1
2 3
84 85