8.1.5.1. Document

class Pyterate.RstFactory.Document.Document(topic, input_file, language)[source]

Bases: object

This class is responsible to process a document.

return the Python symlink path

return the reST symlink path

make_notebook()[source]

Generate a notebook file.

https://nbformat.readthedocs.io/en/latest

make_rst()[source]

Generate the document RST file.

read()[source]

Parse the source code and extract nodes of codes, RST contents, plot and Tikz figures. The source code is annoted using comment lines starting with special directives of the form #directive name#. RST content lines start with #!#. We can include a figure using #lfig#, a figure generated by matplotlib using the directive #fig#, tikz figure using #tz# and the content of a file using #itxt# and #i# for codes. Comment that must be skipped start with #?#. Hidden code start with #h#. The directive #o# is used to split the output and to instruct to include the previous node. RST content can be formatted with variable from the locals dictionary using @<@…@>@ instead of {…}.

Create a symlink to a source in the reST document directory

exception Pyterate.RstFactory.Document.ParseError(message, line)[source]

Bases: Exception