module sphinxext.sphinx_latex_builder

Inheritance diagram of pyquickhelper.sphinxext.sphinx_latex_builder

Short summary

module pyquickhelper.sphinxext.sphinx_latex_builder

Overwrites latex writer as Sphinx’s version is bugged in version 1.8.0.

Classes

class

truncated documentation

CustomizedSphinxFileOutput

Customized FileOutput class for Sphinx.

EnhancedLaTeXBuilder

Overwrites LaTeXBuilder.

EnhancedLaTeXTranslator

Overwrites LaTeXTranslator and modifies …

EnhancedLaTeXWriter

Overwrites LatexWriter.

Functions

function

truncated documentation

setup

Initializes builder EnhancedLaTeXBuilder.

Properties

property

truncated documentation

no_contractions

table

Get current table.

Methods

method

truncated documentation

__init__

__init__

Constructor, add a logger.

__init__

__init__

_get_filename

add_text

depart_inheritance_diagram

depart_only

eval_expr

finish

get_outfilename

Overwrites get_target_uri to control file names.

latex_image_length

render

translate

unknown_visit

visit_document

visit_enumerated_list

visit_inheritance_diagram

visit_only

write

write

Documentation

Overwrites latex writer as Sphinx’s version is bugged in version 1.8.0.

New in version 1.8.

source on GitHub

class pyquickhelper.sphinxext.sphinx_latex_builder.CustomizedSphinxFileOutput(**kwargs)[source][source]

Bases: sphinx.util.docutils.SphinxFileOutput

Customized FileOutput class for Sphinx.

source on GitHub

Parameters

  • destination: either a file-like object (which is written directly) or None (which implies sys.stdout if no destination_path given).

  • destination_path: a path to a file, which is opened and then written.

  • encoding: the text encoding of the output file.

  • error_handler: the encoding error handler to use.

  • autoclose: close automatically after write (except when sys.stdout or sys.stderr is the destination).

  • handle_io_errors: ignored, deprecated, will be removed.

  • mode: how the file is to be opened (see standard function open). The default is ‘w’, providing universal newline support for text files.

__init__(**kwargs)[source][source]
Parameters

  • destination: either a file-like object (which is written directly) or None (which implies sys.stdout if no destination_path given).

  • destination_path: a path to a file, which is opened and then written.

  • encoding: the text encoding of the output file.

  • error_handler: the encoding error handler to use.

  • autoclose: close automatically after write (except when sys.stdout or sys.stderr is the destination).

  • handle_io_errors: ignored, deprecated, will be removed.

  • mode: how the file is to be opened (see standard function open). The default is ‘w’, providing universal newline support for text files.

write(data)[source][source]

Encode data, write it to a single file, and return it.

With Python 3 or binary output mode, data is returned unchanged, except when specified encoding and output encoding differ.

class pyquickhelper.sphinxext.sphinx_latex_builder.EnhancedLaTeXBuilder(*args, **kwargs)[source][source]

Bases: sphinx.builders.latex.LaTeXBuilder

Overwrites LaTeXBuilder.

source on GitHub

Constructor, add a logger.

source on GitHub

__init__(*args, **kwargs)[source][source]

Constructor, add a logger.

source on GitHub

_get_filename(targetname, encoding='utf-8', overwrite_if_changed=True)[source][source]
default_translator_class[source]

alias of EnhancedLaTeXTranslator

finish()[source][source]

Finish the building process.

The default implementation does nothing.

get_outfilename(pagename)[source][source]

Overwrites get_target_uri to control file names.

source on GitHub

class pyquickhelper.sphinxext.sphinx_latex_builder.EnhancedLaTeXTranslator(builder, document)[source][source]

Bases: sphinx.writers.latex.LaTeXTranslator

Overwrites LaTeXTranslator and modifies a few functions.

source on GitHub

__init__(builder, document)[source][source]

Initialize self. See help(type(self)) for accurate signature.

unknown_visit(node)[source][source]

Called when entering unknown Node types.

Raise an exception unless overridden.

class pyquickhelper.sphinxext.sphinx_latex_builder.EnhancedLaTeXWriter(builder)[source][source]

Bases: sphinx.writers.latex.LaTeXWriter

Overwrites LatexWriter.

source on GitHub

__init__(builder)[source][source]

Initialize self. See help(type(self)) for accurate signature.

translate()[source][source]

Do final translation of self.document into self.output. Called from write. Override in subclasses.

Usually done with a docutils.nodes.NodeVisitor subclass, in combination with a call to docutils.nodes.Node.walk() or docutils.nodes.Node.walkabout(). The NodeVisitor subclass must support all standard elements (listed in docutils.nodes.node_class_names) and possibly non-standard elements used by the current Reader as well.

translator_class[source]

alias of EnhancedLaTeXTranslator

pyquickhelper.sphinxext.sphinx_latex_builder.setup(app)[source][source]

Initializes builder EnhancedLaTeXBuilder.

source on GitHub