Retaining inline code inside references in Sphinx

If you have a look at :ref: documentation in its official web site about inline markups: :ref: To support cross-referencing to arbitrary locations in any document, the standard reST labels are used. For this to work label names must be unique throughout the entire documentation … I think (as @Kevin Horn) it’s no possible right … Read more

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

From the Sphinx documentation: The default role (`content`) has no special meaning by default. You are free to use it for anything you like, e.g. variable names; use the default_role config value to set it to a known role. As a matter of personal preference, when writing Python docstrings, I use interpreted text (single backquotes) … Read more

Markdown output for Sphinx based documentation [closed]

I didn’t find anything which could take reStructuredText files and convert them to Markdown except for Pandoc, so I wrote a custom writer for Docutils (the reference implementation of reStructuredText and what Sphinx is built upon). The code is available on GitHub. Note that it is only an initial implementation: it handles any reStructuredText document … Read more

Referencing figures with numbers in Sphinx and reStructuredText

In the latest versions of Sphinx (1.3+), numbering figures and referencing them from text got a bit easier as support for it is now built-in. In your text, you can do something like: .. _label: .. figure:: images/figure.* At :numref:`label` you can see… The end result should be something like “At Fig 1.1 you can … Read more

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

PyPI will not read your package distributions for the image. You have to use the image’s external link, for example: .. image:: https://raw.githubusercontent.com/greyli/flask-share/master/images/demo.png If you are using Markdown description, use this: ![](https://raw.githubusercontent.com/greyli/flask-share/master/images/demo.png) Be sure to replace the URL in the above examples with your image URL, here I use the image hosted by GitHub, the … Read more

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

I found this method working First, you have the role. .. role:: red An example of using :red:`interpreted text` It translates into as follows. <p>An example of using <span class=”red”>interpreted text</span></p> Now, you have the red class, you can use CSS for changing colors. .red { color:red; }

Python docstrings to GitHub README.md

The other answers are great. But I thought I (the OP) ought to share what I do these days (a year or two after the question). I use Sphinx and its Markdown extension. Do the following: TL;DR: See Gist snippet. Sphinx-markdown-builder You need sphinx-markdown-builder python module. pip install sphinx sphinx-markdown-builder; Run Sphinx Not the autodoc, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)