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

Adding a external PDF as appendix with ReStructuredText

I'm writing a major report, and have two PDF files I'd like to include as appendices. The report is written using ReStructuredText, and rst2pdf will be used to convert it. Does docutils or rst2pdf have any functionality for external files as…
Chrizmo
  • 626
  • 2
  • 7
  • 18
1
vote
2 answers

reStructuredText: Automatic table of contents for standalone .rst file

I'm a Markdown user but recently I came across reStructuredText and I wanted to take advantage of its features to create technical documents in pdf. I know this markup language is mainly used with Sphinx to create Python package documentation, but I…
UzbeKistaN
  • 33
  • 4
1
vote
0 answers

Nested references in custom directive

As part of a custom directive I am trying to support nested references. I have re-worked the todo example to demonstrate what I am looking for. The complete repo is here: https://github.com/martynp/sphinx_nested The commit with the changes I would…
MartynP
  • 11
  • 2
1
vote
0 answers

Invoking other directives from my own bespoke directive

I'm making a extension for sphinx, which takes c code block, compiles it with arguments and stores the assembly/listing output to separate file. I take the c code block, the asm code block and the arguments given to gcc to do the compilation. Now…
Anton Krug
  • 1,555
  • 2
  • 19
  • 32
1
vote
1 answer

Supress cross reference hyperlink using exclamation mark

Prefixing the link with an ! suppresses the creation of a reference (e.g. :ref:`!no link` will be simply rendered as no link): If you prefix the content with !, no reference/hyperlink will be created. However, I can't think of any practical usage…
Stef
  • 28,728
  • 2
  • 24
  • 52
1
vote
0 answers

Sphinx- Print in a rst file a custom string variable defined in conf.py

I am defining in conf.py a string variable X that I would like to print in a rst file. Here is what I did : In conf.py: X = "MY CUSTOM STRING" In the rst file: Using |X| But the html shows: instead of showing the content of MY CUSTOM STRING as…
dada
  • 1,390
  • 2
  • 17
  • 40
1
vote
1 answer

docutils ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory

when I run pip show I get FileNotFoundError: [Errno 2] No such file or directory: '/[my_home] /.local/lib/python3.8/site-packages/docutils-0.16.dist-info/METADATA' and when I try to install docutils ERROR: Could not install packages due to an…
jjrr
  • 1,038
  • 2
  • 13
  • 26
1
vote
4 answers

Django docutils not working

I'm trying to enable docutils for django on windows 7. I've enabled the links in urls.y and settings.py and downloaded and installed the latest snapshot of docutils. However every time I try to access the documentation link in the admin I get a page…
fruitmix
  • 11
  • 2
1
vote
1 answer

how to make a custom sphinx role that is also an external link?

I'm trying to extend Sphinx to have a new inline role called newcontrib. What it should do is take its content and (1) add some extra text to it, (2) make the text bold in the rendered output, and (3) make the text a link, whose target is the…
drammock
  • 2,373
  • 29
  • 40
1
vote
0 answers

Transform reST list item for rst2html output

I have a reStructuredText document with todo list items: Vim === - ✓ (2021-11-05) RST Section text object (drop it in favor of env text object) Probably should be based on the output of ``:Toc`` command to properly identify all sub sections…
Maxim Kim
  • 6,192
  • 2
  • 29
  • 28
1
vote
1 answer

Link directives in Rst grammar

How can I link directive with :doi: or :arxiv: in Rst. I'm making a document with Rst, but when I try to link with arxiv, it shows broken link. What I tried is below but not working. <:doi:`10.1145/2487575.2487591>` or :arxiv:`1309.0238`
puhuk
  • 464
  • 5
  • 15
1
vote
0 answers

Using packages in sphinx latex yields "unknown environment "package"" error message

I would like to create a table using latex elements in my sphinx documentation. So far I have added the following lines to my conf.py: latex_engine = 'xelatex' latex_elements = { 'preamble': r''' \usepackage{tabular} ''' } my rst looks…
Yes
  • 339
  • 3
  • 19
1
vote
1 answer

Docutils dependecy of Sphinx theme on readthedocs

I used to keep a project docs on readthedocs.io server. Here is the link CoFEA Initiative Since the 3rd of April, it looks a bit broken (e.g. the main logo is aligned to the left while it should be centered) because a new version of docutils library…
Spike1991
  • 31
  • 6
1
vote
0 answers

How do I set a caption for my generated code block in sphinx

Currently I am using the following code to generate a code block and show some information in it. I'd like to set a caption like with the following rst directive. .. code-block:: python :caption: my_file.py Currently I am using the following…
1
vote
0 answers

SphinxDirective access to config._raw_config data

I need to do something very simple: Access the tag generated by the command line: $ sphinx-build -t Example: $ sphinx-build -t Foo Will create a dictionary entry…
natersoz
  • 1,674
  • 2
  • 19
  • 29