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
0
votes
1 answer

Parse raw rst string using nested_parse

I'm writing a sphinx extension that transforms a custom directive into a flat-table. From inside the .run(self) method, I build a complete flat-table declaration in pure .rst, and I'd like to feed that string into the internal parser, so it is…
Arthur Attout
  • 2,701
  • 2
  • 26
  • 49
0
votes
1 answer

Why does the docutils/Sphinx "include" directive represent a potential security hole?

The source of the claim is in the Docutils documentation, at https://docutils.sourceforge.io/docs/ref/rst/directives.html#include: Warning The "include" directive represents a potential security hole. It can be disabled with the…
Yerushalmi
  • 53
  • 4
0
votes
1 answer

Sphinx Using Domain Data/Indices

i was following the Tutorial for the “recipe” extension (https://www.sphinx-doc.org/en/master/development/tutorials/recipe.html). I am a little confused as the compiled html side doesn't show the ingredients defined in the contains option. Does…
0
votes
0 answers

Custom sphinx directive fails when the content contains a nested glossary 'term' role

I have developed a sphinx extension for creating dependencies between different sections of a document. The primary application is plain text requirements management. The main object in the extension is a 'Vertex' directive. Arbitrary content can be…
0
votes
0 answers

Combining replace and include in reStructuredText / Sphinx

I have been searching for a solution to this, but have just got even more confused! I have a use case in my documentation to replace many instances of a name for a piece of equipment. I had been using the reST directive replace, so for instance: ..…
Mark Lees
  • 1
  • 1
0
votes
0 answers

Create document without source, based on parse sources

With a sphinx extension, can I create additional sphinx pages not related to a specific source file? source files: foo.xml bar.xml output files: foo.html bar.html wanted.html The wanted file would be explicitly created by my extension, using info…
Fab-B
  • 41
  • 4
0
votes
0 answers

Error: couldn't find version that satisfied requirements docutils==0.16 and no matching distribution found for docutils

While I was installing requirements.txt using: pip install -r requirements.txt. I got this error WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by…
Anu
  • 1
  • 2
0
votes
0 answers

Sphinx can't generate link text as literal

With Markdown, I can simply: [`a link with monospace font`](https://www.example.com) a link with monospace font Note how the above line is properly rendered by SO's MD renderer: the link text is in code (monospace) syntax. I'm trying to achieve the…
Leonardo
  • 1,533
  • 17
  • 28
0
votes
1 answer

How to create an custom sphinx extention that works in latex

I created a super small extention to add the role "icon" in my doc. The idea is to write down the following : I'm a folder :icon:`fa fa-folder` I adapted some code find online and came up with the following: from docutils import nodes def…
Pierrick Rambaud
  • 1,726
  • 1
  • 20
  • 47
0
votes
1 answer

How do I format code neatly in HTML/CSS ? I especially want to use the numerical circle callouts, with Python Docutils if I can

see: http://diveintopython.net/native_data_types/lists.html#d0e5623 I have a website with code examples on it, generated through docutils, and the CSS is always not quite right. I would like to know if there is best practise CSS for displaying…
lifeisstillgood
  • 3,265
  • 2
  • 21
  • 22
0
votes
1 answer

Extracting blocks of text from RST documents,files by :ref:?

I have a rst file SWAP.rst and i need to extract some specific data and put in a dictionary. the file looks like this: :baseID: SWAP_DF The current used for the force ... .. requirement::SWAT_FD_AR_Force.432 :c_This_is_a: functional …
0
votes
1 answer

Creating a sphinx extension involving a directive that takes in arguments

I am relatively new to writing sphinx extensions and would like to create one that takes in a number of keywords that are provided alongside the directive name inside the rst document and replaces it with a block of html. The predefined list-table…
Yes
  • 339
  • 3
  • 19
0
votes
0 answers

Exact docutils equivalent for :ref:

The following ReStructuredText contains the :ref: role, which is a Sphinx-extension: Read more in :ref:`section-target`. .. _section-target: Section Title ============= Text body. Where :ref:`section-target` is parsed to the following…
MacFreek
  • 3,207
  • 2
  • 31
  • 41
0
votes
0 answers

Python Sphinx Validate and update schema

I'm using Sphinx to maintain docs on a project, I am generating a jsonschema document from a tool where all properties of objects are listed. Those objects properties are documented in rst files, I need to: I've managed to read the rst files in the…
Guillermo Ruffino
  • 2,940
  • 1
  • 26
  • 23
0
votes
0 answers

What arguments to pass to inliner.parse() inside a custom role

I am defining my custom role that allows :ref: markups to be inside of it. The role is to be used as follows: myrole:`some_text |SUBS| more_text` A function replaces |SUBS| by :ref:`some_target` so I end up with the following string some_text…