Questions tagged [docutils]

a general purpose document processing system written in Python.

Docutils is an open-source text processing system for processing plain text documentation into useful formats such as HTML, LaTeX, man-pages, open-document or XML. It includes the markup language.

The Docutils homepage may be found here.

180 questions
2
votes
1 answer

csv-table reference as table number rather than table name

I am making a document with many tables. But, the only way I know how to refer to them in the text is with a :ref:'my_table' and that puts the entire table name, "The long title of my table" in my text block. I would rather have it put in "Table…
Justin
  • 42,475
  • 9
  • 93
  • 111
2
votes
1 answer

How to i18n method comment for displays django-admindoc

I am writing a method to my class and I like internationalize my projects. Now I'm developing a really multilingual system. I want to translate documentation. About how to translate new line after the definition of the method is nothing in the…
mosquito
  • 152
  • 1
  • 7
2
votes
0 answers

How to create a new document in Sphinx/docutils by API?

I' writing a new extension for Sphinx as a domain offering multiple directives, roles and indices for the hardware description language VHDL. This extension shall be able to auto document language constructs. In VHDL, we have e.g.…
Paebbels
  • 15,573
  • 13
  • 70
  • 139
2
votes
0 answers

Nested nodes in sphinx extension

I am trying to make a sphinx extension (for html output) that generates a code block and inserts text and spans into it. However when I create a literal_block (code block) and add inlines (spans) to it, only the text of the inline nodes will appear…
Jonas
  • 56
  • 6
2
votes
1 answer

MyST-Parser: Auto linking / linkifying references to bug tracker issues

I use sphinx w/ MyST-Parser for markdown, and I want GitHub or GitLab-style auto linking (linkfying) for references. Is there a way to have MyST render the reference: #346 In docutils-speak, this is a Text node (example) And behave as if it…
tony
  • 870
  • 7
  • 16
2
votes
2 answers

How do I unparse restructured text back into an rst file?

My question is a follow up to How to parse restructuredtext in python? where @mbdevpl provided code for parsing the file into a tree and doing some processing on the tree. I want to autoformat Python code in RST files. Now that I've discovered the…
Boris Verkhovskiy
  • 14,854
  • 11
  • 100
  • 103
2
votes
1 answer

How do I make my sphinx directive add assets to _static folder?

I'm building a custom sphinx extension and Directive to render interactive charts on sphinx and ReadTheDocs. The actual data for a chart resides in a .json file. In a .rst document, including a chart looks like this: .. chart:: charts/test.json …
thclark
  • 4,784
  • 3
  • 39
  • 65
2
votes
1 answer

How to properly define a new admonition in Sphinx?

With Sphinx it is easy to write extensions, but is it very hard to extend Sphinx in the proper way. I would like to define a custom Admonition so I have: class exercise(nodes.Admonition, nodes.Element): pass class…
nowox
  • 25,978
  • 39
  • 143
  • 293
2
votes
1 answer

How to assemble a tool that parses reStructuredText with additional directives

Let's say I want to add a singe new directive to the reStructuredText standard directives. There is a how-to for creating reStructuredText directives which outlines how each directive is essentially derived from the Directive class or its…
George Boukeas
  • 333
  • 1
  • 11
2
votes
2 answers

Always regenerate Sphinx documents containing a specific directive

Sphinx usually incrementally builds the documentation which means that only files that have been changed will be regenerated. I am wondering if there is a way to tell Sphinx to always regenerate certain files which may not directly have been changed…
aleneum
  • 2,083
  • 12
  • 29
2
votes
1 answer

How can I add something to the heading part of HTML document with docutils

This document (http://docutils.sourceforge.net/docs/ref/rst/directives.html) explains about using .. raw:: to pass through HTML code in docutils, and the HTML code is in the body part of generated HTML. How can I put something in heading part (..)…
prosseek
  • 182,215
  • 215
  • 566
  • 871
2
votes
1 answer

Paragraph tag not rendering in RestructuredText table cell

I define the following table in restructuredtext: +-------------------------+--------------------+ | Label |Description | +=========================+====================+ | foo |Two options: | | …
kldavis4
  • 2,177
  • 1
  • 22
  • 33
2
votes
1 answer

How to programmatically interpret reStructuredText into docutil nodes?

I'm writing custom roles/directives in Sphinx, and I need to insert a node in which I interpret a text string as reStructuredText. Is there a way to do this? I found this source http://agateau.com/2015/docutils-snippets which says how to use…
Jason S
  • 184,598
  • 164
  • 608
  • 970
2
votes
2 answers

rst2odt not showing the third image

I'm trying to convert a rst document with images to odt, but rst2odt seems to fail to get the images from the third one. It worked a year ago and I guess there must be some upgrade that has changed former behavior. A simple doc that reproduces my…
Moisès
  • 37
  • 7
2
votes
0 answers

force bullet level in restructuredtext

Is there a way to force a particular bullet point level in restructured text? I have several bulleted lists in containers, eg. .. container:: + outer entery 1 - inner entry 1.1 - inner entry 1.2 - ... each such…
setrofim
  • 715
  • 3
  • 12