设想
大多数说明建议您可以使用 python 生成 PlantUML 图python -m plantuml example_diagram.txt:我想创建一个 python 脚本,它在创建时生成多个 PlantUML 图,这样我就可以立即更新一组完整的图,而无需运行多个命令。
示例文件
以下文件用于生成 PlantUML 图:
example_flow.txt内容:
' http://tonyballantyne.com/graphs.html#orgheadline19
' http://graphviz.org/doc/info/shapes.html
' Indicate the direction of the flowchart
left to right direction
' Give a block the variable name 'first' and define starting point as (*)
(*) --> "The first block" as first
first --> "A" as A
' Give the block a variable name s.t. you can just use its variable name in the next blocks
--> "D" as D
first --> "B" as B
--> D
first --> "C" as C
--> D
' Define end point as (*)
D --> (*)
Graphviz_example.txt内容:
' http://tonyballantyne.com/graphs.html#orgheadline19
' http://graphviz.org/doc/info/shapes.html
digraph summary{
// initialize the variable blocks
start [label="Start with a Node"]
next [label="Choose your shape", shape=box]
warning [label="Don't go overboard", color=Blue, fontcolor=Red,fontsize=24,style=filled, fillcolor=green,shape=octagon]
end [label="Draw your graph!", shape=box, style=filled, fillcolor=yellow]
// Indicate the direction of the flowchart
rankdir=LR; // Rank direction left to right
// Create the connections
start->next
start->warning
next->end [label="Getting Better...", fontcolor=darkblue]
}
问题
如何从单个 python 脚本创建这些图表?
呼唤远方
相关分类