Questions tagged [restructuredtext]

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

1265 questions
20
votes
2 answers

How to document multiple return values using reStructuredText in Python 2?

The Python docs say that "the markup used for the Python documentation is reStructuredText". My question is: How is a block comment supposed to be written to show multiple return values? def func_returning_one_value(): """Return just one…
Marty Chang
  • 6,269
  • 5
  • 16
  • 25
20
votes
2 answers

Embed external html file using iframe in Sphinx

I'm trying to embed an interactive graph, which is saved as an html file, in a reStructuredText document using iframe: .. raw:: html The html file is in the same directory as my…
shrgm
  • 1,315
  • 1
  • 10
  • 20
20
votes
1 answer

Restructured text (rst) http links underscore ('__' vs '_' use)

With restructured text, I've seen both these used: `Some Link `_ `Some Link `__ Both generate the same output from Sphinx, Whats the difference between using _ or a double underscore __ for http URL…
ideasman42
  • 42,413
  • 44
  • 197
  • 320
19
votes
1 answer

Sphinx: Resume list numbering after a note section

Consider the following list in ReStructuredText: Broken list example ------------------- #. First do spam #. Then do ``eggs`` .. note:: Nobody expects the Spanish Inquisistion #. The list restarts after the note When the list is compiled…
Adam Matan
  • 128,757
  • 147
  • 397
  • 562
18
votes
1 answer

Resize images in Bitbucket wiki pages

I'm trying to resize the images in the wiki pages and nothing is working: the images are always presented with 100% width of the page. I tried with reStructuredText: .. image:: image.jpeg :height: 100px :width: 200px :scale: 50 % :alt:…
gal007
  • 6,911
  • 8
  • 47
  • 70
18
votes
1 answer

ReStructuredText numbered headers

Is there a way in rst to have automatic header numbering ? That is something like: #. Some Section =============== ... #. Some Subsection ------------------ ... #. Another Subsection --------------------- ... #. Another…
gsakkis
  • 1,569
  • 1
  • 15
  • 24
18
votes
2 answers

Substitution in a file name with reStructuredText (Sphinx)?

I want to create several files from a single template, which differ only by a variable name. For example : (file1.rst): .. |variable| replace:: 1 .. include template.rst (template.rst) : Variable |variable| ===================== Image ------- ..…
pierre
  • 770
  • 7
  • 14
18
votes
4 answers

How to do strikethrough in a reStructuredText file hosted on GitHub?

I am converting a README.md file to README.rst. The reason is, I am going to make a package available to PyPi. I am forced to use .rst. My conversion is nearly complete, but I have a strikethrough line in my markdown file, e.g.: ~~This text is…
Santosh Kumar
  • 26,475
  • 20
  • 67
  • 118
17
votes
6 answers

How to create a checklist in reStructuredText (reST)?

I am working on a simple checklist using reStructuredText. To this end I use a bullet list, but I would like to replace the standard bullet points with custom signs, such as empty checkboxes. Optimally, the checkboxes would be clickable in the HTML…
btel
  • 5,563
  • 6
  • 37
  • 47
17
votes
6 answers

Force a new line in Sphinx text

I have Sphinx text in the following format in source code: Line 1 Line 2 Line 3 Line 4 I would like Line 4 to be rendered in HTML on a separate physical line. Is this possible?
Jonathan
  • 2,635
  • 3
  • 30
  • 49
17
votes
1 answer

Is 3-space indentation required in reST?

I'm documenting my Python code using Sphinx, and read in the Python developer's guide (and I think elsewhere as well) that reST files use an indentation of 3 spaces: All reST files use an indentation of 3 spaces; no tabs are allowed. This is the…
Tim
  • 1,839
  • 10
  • 18
17
votes
2 answers

How do I document :rtype: for a function that returns multiple possible data types?

In a Python docstring how should one document the :rtype: for a function that can return multiple possible data types? For example, if a function can return defaultdict OR dict OR list, based on the functions parameters, how do you document…
stack_lech
  • 990
  • 2
  • 10
  • 28
17
votes
3 answers

Is there a reStructuredText markup editor for eclipse

Is there a WiKiText editor plugin for reStructuredText under eclipse? When I edit a .textile file, I get various intelligent editing features (such as line folding) and a preview panel. I find that there are references to reStructuredText under…
KentH
  • 1,204
  • 1
  • 14
  • 23
17
votes
2 answers

Prevent sub-section nesting in Python Sphinx when using toctree

I'm running into a problem in structuring my Sphinx users guide. I would like to form a chapter by having a main landing page (index.rst) that contains the chapter heading and an overview, and then separate sub-sections contained in different…
jeremiahbuddha
  • 9,701
  • 5
  • 28
  • 34
17
votes
4 answers

Referencing long names with Python Sphinx

I'm working on documentation for my Python module (using Sphinx and reST), and I'm finding that when cross-referencing other Python objects (modules, classes, functions, etc) the full object name ends up being incredibly long. Often it is longer…