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

How to get Sphinx working in PyCharm with Python 3.5

This is my first time using Sphinx in PyCharm 5.0 with Python 3.5. When I run sphinx task in PyCharm I get the following error: File "C:\Program Files (x86)\JetBrains\PyCharm 5.0\helpers\docutils\__init__.py", line 63, in class…
nu everest
  • 9,589
  • 12
  • 71
  • 90
2
votes
0 answers

How to get parser error as exception in docutils

I have the following simple piece of code to parse a reSt file and return the corresponding DOM tree. from docutils import nodes, utils from docutils.parsers import rst def _rst_to_dom(self, txt): """Parse reStructuredText and return…
Fernando
  • 595
  • 1
  • 3
  • 12
2
votes
0 answers

Error while parsing a restructured text docstring into HTML

So, I am writing a simple application using the python sklearn library. I need to parse the docstring for any of the sklearn estimator models. I am not familiar with reSTructured text but some quick research from the sklearn "Contributing…
krypto07
  • 280
  • 1
  • 8
2
votes
1 answer

How to control short/long tag names with docutils and pygments?

I have two python codes, one using docutils and the other uses pygments. Both codes process java source files in order to highlight the source code. pygments reads directly java source files and docutils reads RST files that contains code-block…
JFL
  • 1,502
  • 14
  • 18
2
votes
0 answers

Correct use of sphinx tabularcolumns directive

I'm trying to center a single table column using the tabularcolumns directive as documented http://sphinx-doc.org/markup/misc.html?highlight=tabularcolumns#tables Simple example: .. tabularcolumns:: |C|l| +----------+------+ | Num | Name…
user590028
  • 11,364
  • 3
  • 40
  • 57
2
votes
1 answer

Adding custom Exercise Environment blocks in reStructured Text

Is there an environment for formatting exercises? Something like .. exercise:: Count to 10 Write down all the numbers from 1 to (including 10) I.e. this is for an instructional documentation that challenges the reader to work through the…
wirrbel
  • 3,173
  • 3
  • 26
  • 49
2
votes
3 answers

How to escape single quotes in reStructuredText when converting to HTML using Sphinx

For a documentation project I am writing I need to include a table with date format strings. Now almost everything works fine, but at the end I have this slight problem where I want to print a literal ' quote and two literal quotes (separately and…
titusn
  • 1,201
  • 1
  • 12
  • 43
2
votes
1 answer

reStructuredText: how to use continuation lines in tables?

I have the following neat little table in reStructuredText: ====== ======= ====== ===================== Symbol Meaning Type Example ====== ======= ====== ===================== G Era Text "GG" -> "AD" y Year …
titusn
  • 1,201
  • 1
  • 12
  • 43
2
votes
1 answer

How to fix list indentation when using literal blocks in reStructuredText (with Spinx)?

For a documentation project I want to give code examples as lists of bullet points. I convert the .rst files to HTML using Sphinx. This works fine, until I start using literal blocks in the list items. In the example below I would like to display…
titusn
  • 1,201
  • 1
  • 12
  • 43
2
votes
1 answer

add node to rst doctree and save to file

I'd like to insert a custom node into a doctree and save these changes to file. I'm reading the following RST file... Hello World! ############ :date: 2010-10-03 10:20 :author: James Bond This is a test. like this: doctree =…
2
votes
1 answer

Autodoc single module attribute in Sphinx

Say I have documented a variable in a Python module, like so: some_random_name = 'whatever' """The random whatever variable""" Can I include autodocs for that single variable in my .rst file, without also dragging in the module __doc__ string and…
Prof. Falken
  • 24,226
  • 19
  • 100
  • 173
2
votes
1 answer

Math directives in Django ReStructuredText

I am using Django template restructuredtext filter to display an rst file in my template. I have docutils installed, and have added django.contrib.markup to settings.py. Displaying rst text works fine. Now, I want to add some math to the rst…
zaphod
  • 2,045
  • 1
  • 14
  • 18
2
votes
2 answers

how to change command for pycharm to convert rst to html

I install docutils and pygment for syntax highlighting on rst files. By using command: rst2html.py file.rst file.html I can get good result. When I use pycharm to compose rst file, it has build-in script to comvert rst: C:\Python27\python.exe…
CSJ
  • 2,709
  • 4
  • 24
  • 30
2
votes
1 answer

Python dictionary "copy value"

I was looking at the docutil source code (which is in python), when I saw this (redacted) : def __init__(self, **attributes): for att, value in attributes.items(): att = att.lower() if att in self.list_attributes: #…
Sebastien F.
  • 1,613
  • 2
  • 23
  • 40
2
votes
1 answer

Align image both horizontally and vertically

Using docutils, it doesn't seem possible to align an image both horizontally and vertically in reStructuredText. Vertical alignment is only accepted for substitutions, while horizontal alignment only works for inline images, thus: .. image::…
raphink
  • 3,625
  • 1
  • 28
  • 39