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
您可以指定height、width、scale和align:
.. 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 对于pdflatex或eps对于platex。
- 工厂
- epstopdf可执行文件的路径。(默认值:“epstopdf”)
- plantuml语法错误图像
- plantuml应该生成带有渲染错误的图像。(默认值:false)