发布于 2015-09-16 15:48:41 | 233 次阅读 | 评论: 0 | 来源: 网络整理

New in version 0.6.

This extension allows you to embed Graphviz graphs in your documents.

It adds these directives:

.. graphviz::

Directive to embed graphviz code. The input code for dot is given as the content. For example:

.. graphviz::

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

In HTML output, the code will be rendered to a PNG or SVG image (see :confval:`graphviz_output_format`). In LaTeX output, the code will be rendered to an embeddable PDF file.

You can also embed external dot files, by giving the file name as an argument to graphviz and no additional content:

.. graphviz:: external.dot

As for all file references in Sphinx, if the filename is absolute, it is taken as relative to the source directory.

Changed in version 1.1: Added support for external files.

.. graph::

Directive for embedding a single undirected graph. The name is given as a directive argument, the contents of the graph are the directive content. This is a convenience directive to generate graph <name> { <content> }.

For example:

.. graph:: foo

   "bar" -- "baz";
.. digraph::

Directive for embedding a single directed graph. The name is given as a directive argument, the contents of the graph are the directive content. This is a convenience directive to generate digraph <name> { <content> }.

For example:

.. digraph:: foo

   "bar" -> "baz" -> "quux";

New in version 1.0: All three directives support an alt option that determines the image’s alternate text for HTML output. If not given, the alternate text defaults to the graphviz code.

New in version 1.1: All three directives support an inline flag that controls paragraph breaks in the output. When set, the graph is inserted into the current paragraph. If the flag is not given, paragraph breaks are introduced before and after the image (the default).

New in version 1.1: All three directives support a caption option that can be used to give a caption to the diagram. Naturally, diagrams marked as “inline” cannot have a caption.

There are also these new config values:

最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务