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
5
votes
3 answers

:synopsis: not working in Sphinx automodule

I am using Sphinx, really like it, but it won't pick up the module synopsis. No error or anything, just plain ... nothing. This is the module I am trying to autodocument: # vim: set fileencoding=utf-8 : """ .. module:: CONF :synopsis:…
Prof. Falken
  • 24,226
  • 19
  • 100
  • 173
5
votes
1 answer

Is there a reST Writer?

Is there a reST Writer for docutil.nodes trees? I couldn't find one but maybe I'm missing something obvious. Or is it trivial to write one yourself? I want to implement reST-to-reST transformations.
ThomasH
  • 22,276
  • 13
  • 61
  • 62
4
votes
2 answers

reStructuredText for SQL?

I am trying to use DocUtils and reStructuredText to comment SQL code. I can get this to work when I include the markup inside multi-line comments. I then use --Some text:: to introduce each block of code. I cannot get internal hyperlinks to work. …
Chris
  • 41
  • 3
4
votes
1 answer

Is it possible to insert hyperlinks in an ReST literal block?

I know this kind of defeat the purpose of a literal block, however I was wondering if there was any workaround to achieve this. My use case is to put an hyperlink in a block literal of pseudo code, in order to reference details elsewhere in the…
Quentin
  • 1,085
  • 1
  • 11
  • 29
4
votes
2 answers

how to document a single space character within a string in reST/Sphinx?

I've gotten lost in an edge case of sorts. I'm working on a conversion of some old plaintext documentation to reST/Sphinx format, with the intent of outputting to a few formats (including HTML and text) from there. Some of the documented functions…
abathur
  • 1,047
  • 7
  • 19
4
votes
1 answer

NumpyDoc Checking for conformity to the doc spec?

The Numpy project provides a specification for the the formatting of their documentation to support readability and automated extraction (link). They also provide Numpydoc, as an extension to Sphinx, to support extraction of some additional…
Jzl5325
  • 3,898
  • 8
  • 42
  • 62
4
votes
1 answer

Sphinx: local conf for a page?

Can I have page-local value of a conf variable (normally found in conf.py)? For example, I have hyphenator_language = "en-us" in conf.py. Can I have it hyphenator_language = "ru" for a given ReST page of the sphinx document?
Adobe
  • 12,967
  • 10
  • 85
  • 126
3
votes
1 answer

Creating minimal LaTeX syntax from reStructuredText with docutils

I'm making a Python script that takes several text files with reStructuredText syntax and creates one single LaTeX file with Docutils. Everything works great except Docutils creates a lot of extra syntax I don't need. For example with a simple…
Chrizmo
  • 626
  • 2
  • 7
  • 18
3
votes
1 answer

Extracting blocks of text from ReST documents by :ref:?

I have some reStructuredText documentation. I would like to use snippets from it in online help. It seems like one approach would be to 'snip' out pieces of markup by reference, e.g. .. _my_boring_section: Introductory…
kdt
  • 27,905
  • 33
  • 92
  • 139
3
votes
1 answer

Getting "Extension error (sphinx.environment.collectors.toctree)" when adding section nodes in Sphinx extension

I am trying to write a new Sphinx extension. A minimum example of an extension that does something similar to what I want is from docutils import nodes from docutils.parsers.rst import Directive class HelloSection(Directive): def run(self): …
Milliron X
  • 1,174
  • 14
  • 26
3
votes
1 answer

How to parse Sphinx custom directive content to docutil nodes

I'm trying to create a custom directive called LicenceDirective which looks like it: .. licence: Some Software 3.0 :url: https://SomeSoftware.com/downloads :path: /licence_file CONTENT The HTML output of such directive would be:
Oragon Efreet
  • 1,114
  • 1
  • 8
  • 25
3
votes
0 answers

Creating a custom table generator as a sphinx extension

I would like to create a custom directive that functions similar to docutil's list-table element, where I provide a list of arguments afterwards and use them to render a html table with a custom layout. I have tried modifying the helloworld example…
Yes
  • 339
  • 3
  • 19
3
votes
1 answer

Using docutils.core.publish_string instead of publish_cmdline, `settings_overrides` argument carrying HTML-Specific Options takes no effect!

Below is my code from docutils.core import publish_string from docutils.writers.html4css1 import Writer as HisWriter args = { 'stylesheet' : '/home/wonder/lab/css/note.css', 'stylesheet-path' : None, } src = 'ccav' print…
wonder
  • 521
  • 4
  • 11
3
votes
0 answers

Accented characters in Sphinx headings

I want to include accented characters in a Sphinx heading such that I will see the following result: Finalé I have tried the following strategies: Use the unicode character directly such as: Finalé ====== but the character is considered invalid by…
Jonathan
  • 2,635
  • 3
  • 30
  • 49
3
votes
2 answers

Generating labels for nodes of a custom directive

Using the Sphinx "TODO" Directive example I would like to reference the todo instances embedded within a .rst file. For example, if the .rst file content contains: .. todo:: foo .. todo:: bar I can see that the following code (taken from the…
natersoz
  • 1,674
  • 2
  • 19
  • 29
1 2
3
11 12