restructuredtext

How to force non-breaking space in reStructuredText, in code environment?

删除回忆录丶 提交于 2019-12-23 08:34:48
问题 I have this snippet in my reStructuredText document: 1. Find the file at ``~/Google Drive/code/mac/install.sh``. Notice the code/quote environment. Notice the space between Google and Drive in the path. When rendered with Sphinx in HTML, there is a line-wrap between Google and Drive , and the space is gone. (Since this is documentation, I need everything in the code environment to appear to the user exactly as it is entered, which includes the space between 'Google' and 'Drive'. Not only

How do I increase the fixed width font size in Sphinx / reStructured Text?

拟墨画扇 提交于 2019-12-22 06:21:12
问题 I'm using Sphinx to generate documentation which uses reStructured Text as it's markup. However, when I use some inline formatting to make text show up in a fixed width font --no-cache the rendered HTML shows the text in a smaller font. How do I increase the fixed-width font size in Sphinx / reStructured Text so it matches the normal text font-size? Answer With Chris's help I was able to override the default font style in the CSS to increase the fixed-width font size: 1) Edit conf.py to

How do I increase the fixed width font size in Sphinx / reStructured Text?

狂风中的少年 提交于 2019-12-22 06:21:11
问题 I'm using Sphinx to generate documentation which uses reStructured Text as it's markup. However, when I use some inline formatting to make text show up in a fixed width font --no-cache the rendered HTML shows the text in a smaller font. How do I increase the fixed-width font size in Sphinx / reStructured Text so it matches the normal text font-size? Answer With Chris's help I was able to override the default font style in the CSS to increase the fixed-width font size: 1) Edit conf.py to

Sphinx and JavaScript Documentation Workflow [closed]

空扰寡人 提交于 2019-12-22 04:54:29
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . For my JavaScript framework I would like to use Sphinx. Since I am new in the sphinx world I would like you people to help me out getting started with Sphinx and JavaScript. Any help appreciated. Best Regards 回答1: I believe you're looking for Sphinx' JavaScript Domain feature. Edit:

Image in README.rst not displaying in pypi

自古美人都是妖i 提交于 2019-12-22 04:10:13
问题 I would like an image linked in my README.rst file to be displayed when I upload my package to PyPI. In my README I have: .. image:: example-python.png :height: 100px :width: 200px :scale: 100 % :align: center and in MANIFEST.in I have: # Include the image file include example-python.png Right now it's not displaying in testpypi. It shows up just fine on GitHub, however. Am I doing something wrong? 回答1: In .. image:: example-python.png you use relative URL, i.e. a browser expects the image in

Is there a way to create an intermediate output from Sphinx extensions?

青春壹個敷衍的年華 提交于 2019-12-21 22:07:34
问题 When sphinx processes an rst to html conversion is there a way to see an intermediate format after extensions have been processed? I am looking for an intermediate rst file that is generated after sphinx extensions were run. Any ideas? thanks pmoosh 回答1: Take a look at the "ReST Builder" extension: https://pythonhosted.org/sphinxcontrib-restbuilder/. There's not much to say; the extension takes reST as input and outputs ...drumroll... reST! Quote: This extension is in particular useful to use

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

泄露秘密 提交于 2019-12-20 19:47:06
问题 This question already has answers here : How to specify multiple return types using type-hints (3 answers) Closed 10 months ago . 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 this? Code example: from collections import defaultdict def read_state(state_file, state_file_type='defaultdict'): ""

Cant use Ref with a Label using Sphinx doc

核能气质少年 提交于 2019-12-19 12:53:12
问题 I have a problem with using Sphinx-doc's Ref function, i put a label above a paragraph and then i try to link to that label from another doc but inside the same project. The label i use in one document: .. _hal_1k_1p: And the Ref i try to use to link to that label: :ref:`Link title hal_1k_1p` But i only get this error message when building the doc: WARNING: undefined label: link title hal_1k_1p (if the link has no caption the label must precede a section header) What am i doing wrong? 回答1:

How to convert reStructuredText to plain text

ぃ、小莉子 提交于 2019-12-19 12:43:47
问题 I plan to use reStructuredText to write documentation with the main purpose of generating some nice HTML pages. For this I use the docutils rst2html.py tool. However, I may also need to present the documentation in nice plain text format, that is without the reStructuredText markup, and where paragraph wrapping and similar nice formatting is still performed on the text output. But, there is no rst2txt.py tool in the docutils. Is there a way to convert reStructuredText to nice plain text

How to convert reStructuredText to plain text

折月煮酒 提交于 2019-12-19 12:41:24
问题 I plan to use reStructuredText to write documentation with the main purpose of generating some nice HTML pages. For this I use the docutils rst2html.py tool. However, I may also need to present the documentation in nice plain text format, that is without the reStructuredText markup, and where paragraph wrapping and similar nice formatting is still performed on the text output. But, there is no rst2txt.py tool in the docutils. Is there a way to convert reStructuredText to nice plain text