说明.md 8.8 KB

文档地址:https://plantuml.com/zh/

运行命令

# 生成png
java -jar plantuml-mit-1.2025.2.jar ./Consume2.wsl
# 生成svg
java -jar plantuml-mit-1.2025.2.jar -tsvg ./Consume2.wsl

移除生成内容的尺寸

-DPLANTUML_LIMIT_SIZE = 8192

生成svg

java -DPLANTUML_LIMIT_SIZE = 8192 -jar plantuml-mit-1.2025.2.jar -tsvg ./Consume2.wsl

移除jvm的内存限制

java -Xmx1024m -DPLANTUML_LIMIT_SIZE=8192 -jar plantuml-mit-1.2025.2.jar -tsvg ./Consume2.wsl

命令说明

Usage: java -jar plantuml.jar [options] -gui
 (to execute the GUI)
    or java -jar plantuml.jar [options] [file/dir] [file/dir] [file/dir]
 (to process files or directories)

You can use the following wildcards in files/dirs:
 * means any characters but '/'
 ? one and only one character but '/'
 ** means any characters (used to recurse through directories)

where options include:
    -author[s]  To print information about PlantUML authors
    -checkmetadata  Skip PNG files that don't need to be regenerated
    -checkonly  To check the syntax of files without generating images
    -charset xxx To use a specific charset (default is UTF-8)
    -computeurl|-encodeurl To compute the encoded URL of a PlantUML source file
    -cypher  To cypher texts of diagrams so that you can share them
    -DVAR1=value To set a preprocessing variable as if '!define VAR1 value' were used
    -darkmode  To use dark mode for diagrams
    -debugsvek  To generate intermediate svek files
    -decodeurl  To retrieve the PlantUML source from an encoded URL
    -disablestats To disable statistics computation (default)
    -duration  To print the duration of complete diagrams processing
    -e[x]clude pattern To exclude files that match the provided pattern
    -enablestats To enable statistics computation
    -encodesprite 4|8|16[z] "file" To encode a sprite at gray level (z for compression) from an image
    -extractstdlib To extract PlantUML Standard Library into stdlib folder
    -failfast  To stop processing as soon as a syntax error in diagram occurs
    -failfast2  To do a first syntax check before processing files, to fail even faster
    -filedir xxx To behave as if the PlantUML source is in this dir (only affects '-pipe' and PicoWeb 'POST /render')
    -filename "example.puml" To override %filename% variable
    -graphvizdot "exe" To specify dot executable
    -gui  To run the graphical user interface
    -h[elp]  To display this help message
    -htmlstats  To output general statistics in file plantuml-stats.html
    -I/path/to/file To include file as if '!include file' were used
    -I/path/to/*.puml To include files with pattern
    -language  To print the list of PlantUML keywords
    -loopstats  To continuously print statistics about usage
    -metadata  To retrieve PlantUML sources from PNG images
    -nbthread N  To use (N) threads for processing
    -nbthread auto To use 8 threads for processing
    -noerror  To skip images when error in diagrams
    -nometadata  To NOT export metadata in PNG/SVG generated files
    -o[utput] "dir" To generate images in the specified directory
    -overwrite  To allow to overwrite read only files
    -Ppragma1=value To set pragma as if '!pragma pragma1 value' were used
    -p[ipe]  To use stdin for PlantUML source and stdout for PNG/SVG/EPS generation
    -picoweb  To start internal HTTP Server. See https://plantuml.com/picoweb
    -pipeimageindex N To generate the Nth image with pipe option
    -preproc  To output preprocessor text of diagrams
    -printfonts  To print fonts available on your system
    -progress  To display a textual progress bar in console
    -quiet  To NOT print error message into the console
    -realtimestats To generate statistics on the fly rather than at the end
    -Sparam1=value To set a skin parameter as if 'skinparam param1 value' were used
    -splash  To display a splash screen with some progress bar
    -stdlib  To print standard library info
    -syntax  To report any syntax error from standard input without generating images
    -testdot  To test the installation of graphviz
    -theme xxx  To use a specific theme
    -timeout N  Processing timeout in (N) seconds. Defaults to 15 minutes (900 seconds).
    -teps  To generate images using EPS format
    -thtml  To generate HTML file for class diagram
    -tlatex:nopreamble To generate images using LaTeX/Tikz format without preamble
    -tlatex  To generate images using LaTeX/Tikz format
    -tpdf  To generate images using PDF format
    -tpng  To generate images using PNG format (default)
    -tscxml  To generate SCXML file for state diagram
    -tsvg  To generate images using SVG format
    -ttxt  To generate images with ASCII art
    -tutxt  To generate images with ASCII art using Unicode characters
    -tvdx  To generate images using VDX format
    -txmi  To generate XMI file for class diagram
    -v[erbose]  To have log information
    -version  To display information about PlantUML and Java versions
    -xmlstats  To output general statistics in file plantuml-stats.xml

If needed, you can setup the environment variable GRAPHVIZ_DOT.

用法: java -jar plantuml.jar [选项] -gui (运行图形界面)

或 java -jar plantuml.jar [选项] [文件/目录] [文件/目录] [文件/目录]

(处理文件或目录)

文件/目录中可使用以下通配符:

  • 匹配除'/'外的任意字符 ? 匹配单个字符(不能为'/') ** 匹配任意字符(用于递归遍历目录)

选项包括:

-author[s]  显示PlantUML作者信息
-checkmetadata 跳过无需重新生成的PNG文件
-checkonly  仅检查文件语法而不生成图像
-charset xxx 指定字符集(默认为UTF-8)
-computeurl|-encodeurl 计算PlantUML源文件的编码URL
-cypher  加密图表文本以便分享
-DVAR1=value 设置预处理变量(等效于'!define VAR1 value')
-darkmode  使用暗黑模式渲染图表
-debugsvek  生成中间svek文件
-decodeurl  从编码URL还原PlantUML源代码
-disablestats 禁用统计计算(默认)
-duration  显示完整图表处理的耗时
-e[x]clude pattern 排除符合模式的文件
-enablestats 启用统计计算
-encodesprite 4|8|16[z] "file" 将图像编码为灰度精灵图(z表示压缩)
-extractstdlib 将PlantUML标准库提取到stdlib文件夹
-failfast  遇到首个图表语法错误立即停止处理
-failfast2  在处理文件前先进行语法检查以更快失败
-filedir xxx 指定PlantUML源文件的虚拟目录(仅影响'-pipe'和PicoWeb的'POST /render')
-filename "example.puml" 覆盖%filename%变量
-graphvizdot "exe" 指定dot可执行文件路径
-gui  运行图形界面
-h[elp]  显示本帮助信息
-htmlstats  在plantuml-stats.html中输出统计信息
-I/path/to/file 包含文件(等效于'!include file')
-I/path/to/*.puml 按模式包含文件
-language  显示PlantUML关键字列表
-loopstats  持续打印使用统计信息
-metadata  从PNG图像中提取PlantUML源代码
-nbthread N  使用(N)个线程处理
-nbthread auto 自动使用8个线程处理
-noerror  忽略图表错误并跳过图像生成
-nometadata  不在生成的PNG/SVG文件中导出元数据
-o[utput] "dir" 在指定目录生成图像
-overwrite  允许覆盖只读文件
-Ppragma1=value 设置pragma(等效于'!pragma pragma1 value')
-p[ipe]  从stdin读取PlantUML源码并向stdout输出PNG/SVG/EPS
-picoweb  启动内置HTTP服务器(参见<https://plantuml.com/picoweb)>
-pipeimageindex N 在pipe模式下生成第N个图像
-preproc  输出图表的预处理文本
-printfonts  显示系统可用字体
-progress  在控制台显示文本进度条
-quiet  不在控制台打印错误信息
-realtimestats 实时生成统计信息(非最后统一输出)
-Sparam1=value 设置皮肤参数(等效于'skinparam param1 value')
-splash  显示带进度条的启动画面
-stdlib  显示标准库信息
-syntax  检查标准输入的语法错误(不生成图像)
-testdot  测试graphviz安装
-theme xxx  使用指定主题
-timeout N  处理超时时间(N秒,默认15分钟/900秒)
-teps  生成EPS格式图像
-thtml  为类图生成HTML文件
-tlatex:nopreamble 生成无前导码的LaTeX/Tikz格式图像
-tlatex  生成LaTeX/Tikz格式图像
-tpdf  生成PDF格式图像
-tpng  生成PNG格式图像(默认)
-tscxml  为状态图生成SCXML文件
-tsvg  生成SVG格式图像
-ttxt  生成ASCII艺术图像
-tutxt  使用Unicode字符生成ASCII艺术图像
-tvdx  生成VDX格式图像
-txmi  为类图生成XMI文件
-v[erbose]  显示日志信息
-version  显示PlantUML和Java版本信息
-xmlstats  在plantuml-stats.xml中输出统计信息

如需可设置环境变量 GRAPHVIZ_DOT。