module sphinxext.sphinx_gdot_extension

Inheritance diagram of pyquickhelper.sphinxext.sphinx_gdot_extension

Short summary

module pyquickhelper.sphinxext.sphinx_gdot_extension

Defines a sphinx extension to show DOT graph with viz.js or graphviz.

source on GitHub

Classes

class

truncated documentation

gdot_node

defines gdot node.

GDotDirective

A gdot node displays a DOT graph. The build choose SVG for HTML format and image for …

Functions

function

truncated documentation

copy_js_files

depart_gdot_node_html

depart collapse_node

depart_gdot_node_html_svg

depart collapse_node

depart_gdot_node_rst

depart collapse_node

setup

setup for gdot (sphinx)

visit_gdot_node_html

visit collapse_node, the function switches between graphviz.py

visit_gdot_node_html_svg

visit collapse_node

visit_gdot_node_rst

visit collapse_node

Properties

property

truncated documentation

document

Return the document node at the root of the tree containing this Node.

Methods

method

truncated documentation

run

Builds the collapse text.

Documentation

Defines a sphinx extension to show DOT graph with viz.js or graphviz.

source on GitHub

class pyquickhelper.sphinxext.sphinx_gdot_extension.GDotDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]

Bases: Directive

A gdot node displays a DOT graph. The build choose SVG for HTML format and image for other format unless it is specified.

  • format: SVG or HTML

  • script: boolean or a string to indicate than the standard output

    should only be considered after this substring

  • url: url to viz.js, only if format SVG is selected

  • process: run the script in an another process

Example:

.. gdot::

    digraph foo {
        "bar" -> "baz";
    }

Which gives:

The directive also accepts scripts producing dot graphs on the standard output. Option script must be specified. This extension loads sphinx.ext.graphviz if not added to the list of extensions:

Example:

.. gdot::
    :format: png

    digraph foo {
        "bar" -> "baz";
    }

digraph foo { "bar" -> "baz"; }

The output can be produced by a script.

source on GitHub

_default_url = 'http://www.xavierdupre.fr/js/vizjs/viz.js'[source]
final_argument_whitespace = False[source]

May the final argument contain whitespace?

has_content = True[source]

May the directive have content?

node_class[source]

alias of gdot_node

option_spec = {'format': <function unchanged>, 'process': <function unchanged>, 'script': <function unchanged>, 'url': <function unchanged>}[source]

Mapping of option names to validator functions.

optional_arguments = 0[source]

Number of optional arguments after the required arguments.

required_arguments = 0[source]

Number of required directive arguments.

run()[source]

Builds the collapse text.

source on GitHub

pyquickhelper.sphinxext.sphinx_gdot_extension.depart_gdot_node_html(self, node)[source]

depart collapse_node

source on GitHub

pyquickhelper.sphinxext.sphinx_gdot_extension.depart_gdot_node_html_svg(self, node)[source]

depart collapse_node

source on GitHub

pyquickhelper.sphinxext.sphinx_gdot_extension.depart_gdot_node_rst(self, node)[source]

depart collapse_node

source on GitHub

class pyquickhelper.sphinxext.sphinx_gdot_extension.gdot_node(rawsource='', *children, **attributes)[source]

Bases: admonition

defines gdot node.

source on GitHub

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

setup for gdot (sphinx)

source on GitHub

pyquickhelper.sphinxext.sphinx_gdot_extension.visit_gdot_node_html(self, node)[source]

visit collapse_node, the function switches between graphviz.py and the SVG format.

source on GitHub

pyquickhelper.sphinxext.sphinx_gdot_extension.visit_gdot_node_html_svg(self, node)[source]

visit collapse_node

source on GitHub

pyquickhelper.sphinxext.sphinx_gdot_extension.visit_gdot_node_rst(self, node)[source]

visit collapse_node

source on GitHub