sphinx“plantuml”扩展

sphinxcontrib-plantuml的Python项目详细描述


用法

启用此扩展后,

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinxcontrib.plantuml']

您可能需要在conf.py:

plantuml = 'java -jar /path/to/plantuml.jar'

相反,您可以在路径中安装包装脚本:

% cat <<EOT > /usr/local/bin/plantuml
#!/bin/sh -e
java -jar /path/to/plantuml.jar "$@"
EOT
% chmod +x /usr/local/bin/plantuml

然后,在.. uml::指令下编写plantuml文本:

.. uml::

   Alice -> Bob: Hi!
   Alice <- Bob: How are you?

或者指定外部plantuml文件的路径:

.. uml:: external.uml

您可以指定heightwidthscalealign

.. uml::
   :scale: 50 %
   :align: center

   Foo <|-- Bar

您可以指定标题:

.. uml::
   :caption: Caption with **bold** and *italic*
   :width: 50mm

   Foo <|-- Bar

有关详细信息,请参见PlantUML文档。

配置

工厂
plantuml可执行文件的路径。(默认值:“plantUML”)
plantuml输出格式

HTML渲染器的输出图像类型。(默认值:“png”)

png:generate only .png inside </img>
svg:generate .svg inside <object/> with .png inside </img> as a fallback
svg_img:generate only .svg inside <img/> (browser support)
svg_obj:generate only .svg inside <object/> (browser support)
none:do not generate any images (ignore uml directive)

当svg位于<;object/>;内部时,它将始终呈现完整大小,可能更大 而不是容器。当svg位于<;img/>;内部时,它将考虑容器大小 必要时进行缩放。

plantuml_latex_output_格式

乳胶渲染器的输出图像类型。(默认值:“png”)

eps:generate .eps (not supported by pdflatex)
pdf:generate .eps and convert it to .pdf (requires epstopdf)
png:generate .png
none:do not generate any images (ignore uml directive)

由于嵌入式png看起来很糟糕,建议选择pdf 对于pdflatexeps对于platex

工厂
epstopdf可执行文件的路径。(默认值:“epstopdf”)
plantuml语法错误图像
plantuml应该生成带有渲染错误的图像。(默认值:false)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java刷新JLabel   Java:字符“和\”是一样的吗?   仅限java Spring Kafka事务使用者   java如何强制Apache Tapestry更新javascript?   Maven exec:java:如何打开和读取资源目录中的文件?   java Log4j多线程   neo4j SDN4 java。ClassCastException:java。不能将lang.Integer转换为java。lang.使用AttributeConverter时长   java检查RDD的相等性   java如何创建ArrayList的新实例?   java发现了类org。日食码头。websocket。应用程序编程接口。升级请求,但需要接口   java ProGuard忽略注释默认值   “检索原型:”期间发生内部错误。创建新Maven项目时的Java堆空间   java是否仅在使用资源代码的trywith中遇到被抑制的异常?   java Watson AlchemyLanguage如何设置组合调用的参数