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.

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

Methods

method

truncated documentation

run

Builds the collapse text.

Documentation

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

New in version 1.9.

source on GitHub

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

Bases: docutils.parsers.rst.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

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"; }

source on GitHub

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

alias of gdot_node

run()[source][source]

Builds the collapse text.

source on GitHub

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

depart collapse_node

source on GitHub

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

depart collapse_node

source on GitHub

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

depart collapse_node

source on GitHub

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

Bases: docutils.nodes.admonition

defines gdot node.

source on GitHub

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

setup for gdot (sphinx)

source on GitHub

pyquickhelper.sphinxext.sphinx_gdot_extension.visit_gdot_node_html(self, node)[source][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][source]

visit collapse_node

source on GitHub

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

visit collapse_node

source on GitHub