Questions tagged [restructuredtext]

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

1265 questions
45
votes
7 answers

How to use color in text with ReStructured Text (rst2html.py) or how to insert HTML tags without blank lines?

How can I use color with ReStructured Text? For example, **hello** translates into hello. How can I make ReStructure(rst2html.py) translate something into text? I thought about ..raw:: html, but it…
prosseek
  • 182,215
  • 215
  • 566
  • 871
42
votes
2 answers

Generating an external link in Sphinx

I'd like to link to some URL in my Sphinx docs: blah I have found something similar in the docs: http://sphinx-doc.org/ext/extlinks.html - but it is rather about replacing the custom syntax with the link, by…
Anton Arhipov
  • 6,479
  • 1
  • 35
  • 43
42
votes
1 answer

Part of a word bold in reStructuredText

How can I make a part of a word bold in reStructuredText? Here is an example of what I need: ".rst stands for restructured text."
v_2e
  • 2,603
  • 2
  • 22
  • 29
41
votes
4 answers

How to make an internal link to a heading in sphinx restructuredtext without creating arbitrary labels?

I have a document with many headings and sub-headings. Further into the text I want to link back to one of the headings. How can I do this without the redundancy of :ref: labels? The contents seems to pick up headers just fine. I was hoping for…
caduceus
  • 1,542
  • 2
  • 16
  • 21
40
votes
5 answers

How do I add images to a PyPI readme (that works on GitHub)?

In my readme on GitHub I have several images that are present there in my project's source tree which I reference successfully with directives like .. image:: ./doc/source/_static/figs/moon_probe.png I would also like to have these images appear…
orome
  • 45,163
  • 57
  • 202
  • 418
39
votes
1 answer

Insert relative link in reStructuredText

I am documenting a library that has a Python component and a JavaScript component. The overall user documentation, and the Python API documentation are in reStructuredText, processed with Sphinx. The JavaScript API is in jsdoc and is processed with…
Dan Menes
  • 6,667
  • 1
  • 33
  • 35
37
votes
5 answers

Referencing figures with numbers in Sphinx and reStructuredText

When writing RST that will be processed with Sphinx, I can't get Sphinx LaTeX output to use figure numbers when referencing figures. For instance, this code: The lemmings are attacking, as can be seen in :ref:`figlem`. .. _figlem: .. figure::…
Lucas
  • 6,328
  • 8
  • 37
  • 49
37
votes
2 answers

reStructuredText in Sphinx and Docstrings: single vs. double back-quotes or back-ticks difference

From the documentation, it appears that the double back-quote is used for literals, while the single back-quote is used when there is code text to be intepreted. This would lead me to to write the docstring for method f() below: class A(B): …
Jeet
  • 38,594
  • 7
  • 49
  • 56
37
votes
3 answers

Markdown output for Sphinx based documentation

I found myself with a use case, where in addition to generating HTML and PDF from my Sphinx based documentation sources, I would also like to generate a Markdown version of the reStructuredText source files. My preliminary research didn't find any…
Pedro Romano
  • 10,973
  • 4
  • 46
  • 50
36
votes
1 answer

Retaining inline code inside references in Sphinx

In Sphinx, if I have the following heading declaration: .. _somestuff: ``this is code``, this is not! ============================== It renders, like this:     this is code, this is not! Which is good, but, if I use the reference, e.g: Have a look…
tjm
  • 7,500
  • 2
  • 32
  • 53
35
votes
2 answers

How to add extra whitespace between section header and a paragraph

I want to have more space between the header and the paragraph and between the paragraphs. I doesn't want this to be a global setting but I want to use it where and when required. Appreciate any suggestions.
Aravind Yarram
  • 78,777
  • 46
  • 231
  • 327
34
votes
5 answers

How to right-align columns content in reStructuredText simple tables?

I'm editing the documentation for a project of mine using Sphinx, which in turn uses reStructuredText as markup language. I have a simple table (as opposed to grid table) in which the rightmost column reports contains numbers that I would like to…
mac
  • 42,153
  • 26
  • 121
  • 131
34
votes
4 answers

How to remove the cause of an unexpected indentation warning when generating code documentation?

The documentation code with the problem is at the beginning of a method: """ Gtk.EventBox::button-release-event signal handler. :param widget: The clicked widget (The Gtk.EventBox). :param event: Gdk.EventButton object with information regarding …
silviubogan
  • 3,343
  • 3
  • 31
  • 57
34
votes
8 answers

Sphinx, reStructuredText show/hide code snippets

I've been documenting a software package using Sphinx and reStructuredText. Within my documents, there are some long code snippets. I want to be able to have them hidden as default, with a little "Show/Hide" button that would expand them…
Adam Matan
  • 128,757
  • 147
  • 397
  • 562
34
votes
1 answer

How to insert blank line using reStructuredText / Sphinx

I want to add a blankline (or add more whitespace) between heading and the image using ReStructuredText: ==== John ==== .. image:: _static/john.JPG :alt: John :height: 300px :width: 400px But I don't know how to do it?
xxks-kkk
  • 2,336
  • 3
  • 28
  • 48
1 2
3
84 85