restructuredtext

Sphinx: Resume list numbering after a note section

╄→гoц情女王★ 提交于 2019-11-29 09:35:44
Consider the following list in ReStructuredText : Broken list example ------------------- #. First do spam #. Then do ``eggs`` .. note:: Nobody expects the Spanish Inquisistion #. The list restarts after the note When the list is compiled in Sphinx , the number after the note are reset to 1 : Any idea how to continue the numbered list after a note section? ddbeck The discontinuity of the list is caused by the note being a standalone element, not a child of the second numbered list element. To prevent the discontinuity of the list, start the note directive at the same indentation (in this case,

PyCharm change file type association

拟墨画扇 提交于 2019-11-29 01:28:34
问题 I have a file in PyCharm and its used to be just a .txt file. Now I wanted to use .rst (reStructuredText). I know that when I open a file without an ending for the first time PyCharm asks me what kind of file it is and how the syntax should therefore be interpreted. Can i open up that dialog again somehow, or can I change the association in some other way? 回答1: Actually, @CrazyCoder is right: If you accidentally mis-labeled the file, PyCharm remembers it and sets a "pattern" for the new file

Referencing figures with numbers in Sphinx and reStructuredText

与世无争的帅哥 提交于 2019-11-28 21:08:30
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:: _static/lemming_invasion.* They're coming! Will be converted into this: The lemmings are attacking, as can be seen in They're coming! /image goes here/ Figure 1.1: They're coming! But what I want is the "standard" LaTeX way of referencing figures, like this: The lemmings are attacking, as can be seen in Figure 1.1 How do I achieve this? The code I'm

Substitutions inside links in reST / Sphinx

我的梦境 提交于 2019-11-28 19:29:38
I am using Sphinx to document a webservice that will be deployed in different servers. The documentation is full of URL examples for the user to click and they should just work. My problem is that the host, port and deployment root will vary and the documentation will have to be re-generated for every deployment. I tried defining substitutions like this: |base_url|/path .. |base_url| replace:: http://localhost:8080 But the generated HTML is not what I want (doesn't include "/path" in the generated link): <a href="http://localhost:8080">http://localhost:8080</a>/path Does anybody know how to

sphinx, restructuredtext: set color for a single word

妖精的绣舞 提交于 2019-11-28 18:22:26
Is there a way to set the color of single words (or characters) in sphinx ? I'm pretty sure there should be some markup tag, like HTML's font tag. If you want to do this without being tied to html, try applying a different style than normal body text to your word. In this example adapted from the rst2pdf manual, I apply the existing rubric style which is red in the backend that I am using: Before red. .. role:: rubric I like color :rubric:`rubric`. After red. The actual look of the word will depend on how the style you choose is defined in the stylesheet that you use when generating your

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

百般思念 提交于 2019-11-28 18:15:43
How can I use color with ReStructured Text? For example, **hello** translates into <strong>hello</strong> . How can I make ReStructure(rst2html.py) translate something into <font color="####">text</font> ? I thought about ..raw:: html, but it introduces blank lines. I want 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 {

Adding a cross-reference to a subheading or anchor in another page

回眸只為那壹抹淺笑 提交于 2019-11-28 16:27:24
How to insert a cross-reference in a reST/Sphinx page to either a sub-header or anchor in another page in the same documentation set? Jan Vlcinsky Ignore this answer, it does not work: Better use the answer from Louis , below For anchor, you may define "short" anchor names like this: .. _ShortAnchor: Target Header goes here ======================= Some text. To refer to that header use: For more details, see ShortAnchor_. Note, that this even expands ShortAnchor to full name of the header. You may also use full header name like: See `Target Header goes here`_ chapter. But this is more error

Parsing reStructuredText into HTML

风流意气都作罢 提交于 2019-11-28 15:57:50
I'm making a framework in which I let developers describe their package using reStructuredText. I want to parse that reStructuredText into HTML so I can show it in a GUI. I'm familiar with the excellent Sphinx, but I've never otherwise parsed reStructuredText. I imagined something like a function that takes a string of reStructuredText, and possibly several additional arguments, and returns a string of HTML. So I looked into Docutils, which is responsible for parsing reStructuredText. I couldn't understand at all how to find this function. Documentation on the web is spotty. Many of the

Math in reStructuredText with LaTeX

拥有回忆 提交于 2019-11-28 14:46:31
问题 I would like to use a lightweight markup language to take notes in my college classes. My editor of choice is gedit, and I found reStructuredText Tools for Gedit, which will run the reStructuredText processor and render the HTML in a pane in gedit. This is great, and 80% of the way there. But for many of my classes I need to include math equations or greek characters in my notes. Although I'm not very familiar with LaTeX, my understanding is that it has these capabilities. How can I use LaTeX

reStructuredText tool support

喜你入骨 提交于 2019-11-28 13:08:46
问题 I am a great fan of reStructuredText, however the tools that support it are scattered all over the Internet. The official tool list is incomplete and/or outdated, and can be updated only via commit privileges. For some time there was a comprehensive list at the Wikipedia reStructuredText page, but this apparently "did not meet the notability guideline for web content" and was removed. So to put it in a question form: What tool support can one expect to find when working with reStructuredText,