restructuredtext

Inserting an image in sphinx

元气小坏坏 提交于 2019-12-11 18:01:18
问题 Im trying to insert an image my documentation page,going through the documentation i have it done like this **Tutorial on Training model** ============================== .. image::/home/predible/Desktop/sixfortyintofoureighty.png When i run make html It does not throw any error but the image does not display in the documentation,Any suggestions on how do i get my image to display would be really helpful,thanks in advance. 回答1: There should be a space between .. image:: and the path to the

Is there any way to change the order and type of numbers in table of contents of restructured texts?

◇◆丶佛笑我妖孽 提交于 2019-12-11 07:39:20
问题 Using restructured texts is an easy way for writing formatted texts. But there are some problems regarding to left to right languages. I appreciate any helpful comment to solve these problems or at least some helpful guidance. I usually use rst2html to convert rst files to htmls. 1- "section-numbering" always produces left to right numbering while in right to left languages like Farsi, Arabic, Urdu, and Hebrew the order of numbers must be reversed. The digits of numbers have the same position

Standardizing a link using a global variable in Sphinx documentation

久未见 提交于 2019-12-11 05:48:34
问题 I'm using Sphinx to document a project for work. I want to use the same link that points to a download on multiple pages throughout my documentation. For example: home.rst: Hi == I want you to download_ my project. .. _download: blah.com/download other_page.rst Hello Again =========== You can also download_ it here. .. _download: blah.com/download Is there some way to have one variable that each page points to so when the link needs updated only on variable needs to be updated? 回答1: The best

Sphinx add code formatting to :ref:

*爱你&永不变心* 提交于 2019-12-11 05:27:30
问题 I would like to add code formatting to a reference like this: :ref:`__slots__ <python:slots>` My intersphinx_mapping defines python like this: intersphinx_mapping = { 'python': ('https://docs.python.org/3', None), } so the link is to https://docs.python.org/3/reference/datamodel.html#slots ( slots is defined in the std:label section of https://docs.python.org/3/objects.inv ) My goal is to format the rendered link in the style of :py:attr: or similar rather than the default text style with

Sphinx: How to automatically generate documentation from XML Schema (XSD)

本小妞迷上赌 提交于 2019-12-11 04:38:32
问题 We want to document an XML file structure using the self-documented XSD schema file. As Sphinx provides some autodoc support for some languages, is there an equivalent way to generate some kind of good looking documentation directly from XSD ? NB: we use Sphinx / ReStructuredText for project documentation. 回答1: A great XSD documentation generator you can find here: http://www.flexdoc.xyz/flexdoc-xml/xsddoc/ It generates highly detailed XML schema documentation with diagrams: 来源: https:/

“Unexpected indentation” with restructuredtext list

倖福魔咒の 提交于 2019-12-11 01:49:12
问题 I did not succeed to get a simple 3 levels indented list with Restructuredtext: $ cat test.rst Title ====== - aaaa - aaaa2 - aaaa2 - aaaa3 - aaaa - aaaa Ok $ rst2html test.rst > /tmp/a.html test.rst:7: (ERROR/3) Unexpected indentation. $ I've try different combination of spaces in front of aaaa3 but I get in all cases (ERROR/3) Unexpected indentation. 回答1: Nested lists are tricky because different levels require blank lines between those levels. Nested lists are possible, but be aware that

Is it possible to make automatic section header numbering in reST start at subsection level?

空扰寡人 提交于 2019-12-11 01:19:57
问题 Is there anyway to get reST to start numbering the sections only, at say, the second level? I am using the auto-numbering setting: .. section-numbering:: What I would like is for the input: Section A ========= Subsection A.1 ------------ Subsection A.2 ------------ Section B ========= Subsection B.1 ------------ Subsection B.2 ------------ to output Section A and B's headers unnumbered, but number the subsections (that is, Subsection A.1, A.2 and B.1, B.2). Having looked through the

Inconsistent line spacing in RestructuredText document

倖福魔咒の 提交于 2019-12-11 01:14:39
问题 I'm build RST files for my company's documentation. One irritating thing is that enumerated lists don't seem to have any consistency in terms of line spacing. Is there a simple way to solve this? Robert 回答1: It's a well known problem of docutils , the library on which Sphinx is built. From Sphinx issue tracker on GitHub: tk0miya wrote: In my short investigation: The behavior comes from docutils (base library of Sphinx). In docutils.writers.html4css1.HTMLTranslator , docutils generates <p> tag

If possible, how do we put hyperlink within the code section in rst files?

自闭症网瘾萝莉.ら 提交于 2019-12-10 20:29:02
问题 I have the following in an rst file: .. code-block:: bash user@adi:~/workspace$ pytest test/test/functional/example/test_api_2.py --testbed test/test/topo_confs/pytest_tb.json --loglevel DEBUG --html /home/user/test.html --self-contained-html Now how do I put a hyperlink on the pytest_tb.json word in that code? 回答1: .. code-block:: only applies syntax highlighting to literal code, which means it does not support hyperlinks by interpreting reStructuredText markup. Instead you could use a

Skipping heading levels in reStructuredText

[亡魂溺海] 提交于 2019-12-10 18:20:41
问题 Is it possible in some way to skip heading levels in RestructuredText? For example, given #### PART #### ******* Chapter ******* Section ======= Subsection ---------- Subsubsection ^^^^^^^^^^^^ Paragraph """"""""" Another section =============== Another Paragraph """"""""""""""""" The above heading seems to be rendered as a subsection-level heading... The last paragraph gets rendered as a subsection instead of as a paragraph. (I am using Sphinx as a renderer.) So it seems section-level