restructuredtext

Sphinx: Multiple (Nested) Roles

懵懂的女人 提交于 2020-01-16 17:05:00
问题 in my Sphinx docs I would like to create a glossary, potentially containing :math: , or other roles: .. glossary:: :math:`f(x)` Description Is there any way to reference this entry with a text that has the same style as the glossary entry? :term:`f(x)` Works, but is rendered as a plain hyperlink. I want a hyperlink with the original styling instead: :term:`:math:`f(x)`` Does not work. :term:`:math:`f(x)` <f(x)>` Also doesnt. Many thanks for the help. 来源: https://stackoverflow.com/questions

Sphinx: Multiple (Nested) Roles

一世执手 提交于 2020-01-16 17:03:08
问题 in my Sphinx docs I would like to create a glossary, potentially containing :math: , or other roles: .. glossary:: :math:`f(x)` Description Is there any way to reference this entry with a text that has the same style as the glossary entry? :term:`f(x)` Works, but is rendered as a plain hyperlink. I want a hyperlink with the original styling instead: :term:`:math:`f(x)`` Does not work. :term:`:math:`f(x)` <f(x)>` Also doesnt. Many thanks for the help. 来源: https://stackoverflow.com/questions

docutils/reStructuredText template features

我们两清 提交于 2020-01-16 12:02:43
问题 How could I customize placeholders in my .rst file with actual values? For example, I have example.rst file with following content: Header ------------------------------------ ${custom_text} I want to replace ${custom_text} property with the value this is the value of custom property by running following command: rst2html example.rst -o example.html -Dcustom_text="this is the value of custom property" Also I wonder whether it is possible to customize template using .properties file? For

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

故事扮演 提交于 2020-01-12 04:20:09
问题 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 something like this: `#polled-data-retrieval`_ . 回答1: reStructuredText supports implicit hyperlink targets. From the reStructuredText quick reference: Section titles, footnotes, and citations automatically generate hyperlink targets (the title text or

Overriding the default field name limit in sphinx/docutils

☆樱花仙子☆ 提交于 2020-01-10 10:35:09
问题 I am using sphinx for generating html documentation for a project. I make extensive use of field lists. When generating html, each label/value pair is rendered as a single table row with two cells if the lenght of the label is at most 14 characters. If the label of one pair is longer than 14 characters, the label/values are rendered as two table rows. I want to increase the wrapping limit to a larger value (e.g. 40). I have found that the limit is controlled by the --field-name-limit option

Italicize text containing a link

余生长醉 提交于 2020-01-10 08:50:29
问题 I have an RST where I want an italicized link. However, the markup *Warning: `Watch this <http://www.youtube.com/watch?v=dQw4w9WgXcQ&ob=av3e>`_!* renders in HTML as <em>Warning: `Watch this <http://www.youtube.com/watch?v=dQw4w9WgXcQ&ob=av3e>`_!</em> That is, the italics render but the link doesn't. How do I get italics around the link? 回答1: The problem is that reST markup cannot be nested. I managed to get it work with this: Warning: |text|_ .. _text: http://www.youtube.com/watch?v

Can multiple paragraphs be substituted into reStructuredText table cells?

此生再无相见时 提交于 2020-01-06 06:31:32
问题 I have a reST formatted table where some cells contain long blocks of text (i.e. multiple paragraphs or bulleted lists) and they get updated periodically, for example: +-------+-----------------------+ |Cat | Chunk that is updated | | | periodically. | | | | | | Line #2, #3, etc | +-------+-----------------------+ |Dog | Substitution means | | | table boilplat static | | | | | | Line #2, #3, etc | +-------+-----------------------+ To avoid maintenance of the table boilerplate every update, I

Printable PDF output with links as footnotes

穿精又带淫゛_ 提交于 2020-01-05 10:03:20
问题 I'm using sphinx to generate the documentation of a python project and I'm making heavy use of external links. I'd like to build html and latexpdf outputs with these as clickable links (which is the default), but also a PDF version that will be printed, with these links showing up in footnotes. In short: is there a way to write external links in a .rst file like this: Ask a question on `my favorite Q&A website <http://stackoverflow.com/>`_. and have a special output that will interpret this

Printable PDF output with links as footnotes

北城以北 提交于 2020-01-05 10:02:11
问题 I'm using sphinx to generate the documentation of a python project and I'm making heavy use of external links. I'd like to build html and latexpdf outputs with these as clickable links (which is the default), but also a PDF version that will be printed, with these links showing up in footnotes. In short: is there a way to write external links in a .rst file like this: Ask a question on `my favorite Q&A website <http://stackoverflow.com/>`_. and have a special output that will interpret this

Format tables in reStructuredText

喜欢而已 提交于 2020-01-05 08:25:33
问题 I have a table issue when using Sphinx with the bootstrap theme ( build html ). Is there a way to format the table such that it wouldn't stretch on the entire screen width? I would like the columns to have the text width and the overall table to be center aligned. What about column alignment? Could I center align some of the columns? Here is a screenshot with how the table looks like right now: http://imgur.com/Q4Idzyd 来源: https://stackoverflow.com/questions/19241651/format-tables-in