简体   繁体   English

如何包括.iuml路径以在Doxygen中生成PlantUML图

[英]How to include .iuml path to generate PlantUML diagram in Doxygen

I'm working on the documentation of a component using Doxygen and I want to include UML diagrams in between the text. 我正在使用Doxygen处理组件的文档,并且希望在文本之间包含UML图。

I know how to do most of it, as I simply need to copy the .tuml source into my .dox file and run doxygen . 我知道该怎么做,因为我只需要将.tuml源代码复制到我的.dox文件中并运行doxygen However, one of my diagrams is a class diagram that includes other .iuml files, like explained in the PlantUML site . 但是,我的图之一是包含其他.iuml文件的类图,如PlantUML 网站中所述

So, basically, I do: 因此,基本上,我这样做:

@mainpage main_page MyDoxygen
\
...
\
@startuml
\
!include iuml_files/Class01.iuml
!include iuml_files/Class02.iuml
\
MainClass <|-- Class01
MainClass <|-- Class02
\
@enduml

Long story short, I don't know how to make Doxygen understand it must look for the .iuml files in the directory (relative path) I'm giving as argument to the include directive. 长话短说,我不知道如何使Doxygen理解它必须在我作为include指令的参数给出的目录(相对路径)中查找.iuml文件。

If I wasn't clear enough as to what I need, please let me know and I will try make it clearer. 如果我对自己的需求不够清楚,请告诉我,我会尽力使其更清楚。

Can I please get some help? 我可以帮忙吗?

I had a similar problem (I own the Word Add-in for plantuml) 我有一个类似的问题(我拥有plantuml的Word加载项)

You can specify the java property "plantuml.include.path" in the command line : java -Dplantuml.include.path="c:/mydir" -jar plantuml.jar atest1.txt (see http://plantuml.sourceforge.net/preprocessing.html ) 您可以在命令行中指定java属性“ plantuml.include.path”:java -Dplantuml.include.path =“ c:/ mydir” -jar plantuml.jar atest1.txt(请参见http://plantuml.sourceforge。 net / preprocessing.html

I expect it'll work when you modify the batch file for calling Plantuml http://plantuml.sourceforge.net/doxygen.html 我希望当您修改用于调用Plantuml的批处理文件http://plantuml.sourceforge.net/doxygen.html时 ,它将起作用

I had a similar request for my Word Addin for Plantuml and here it worked. 我对Plantuml的Word插件有类似的要求,并且在这里有效。

The Real Answer 真正的答案

Use the PLANTUML_INCLUDE_PATH = ./someRelativeDir configuration, visible in the Doxygen wizard's DOT panel. 使用PLANTUML_INCLUDE_PATH = ./someRelativeDir配置,该配置在Doxygen向导的DOT面板中可见。

The include path is relative to your Doxygen config, ie the starting directory from which the doxygen config is taken. 包含路径是相对于您的Doxygen配置的,即从中获取doxygen配置的起始目录。

A Red Herring 红鲱鱼

I'm leaving the rest of this answer here in case anyone found it previously. 如果有人先前找到了它,我将在此处保留其余答案。

I wrongly reported a bug because I needed new reading glasses and didn't notice a stray character in my path. 错误地报告了一个错误,因为我需要新的老花镜,并且在走行途中没有注意到杂散的字符。

This was resolved as not a Doxygen bug 已解决不是 Doxygen错误

For any interested parties, this is what I saw. 对于任何有兴趣的人士,这就是我所看到的。

Running PlantUML on generated file /Users/andydent/dev/touchgramdesign/doxygeneratedTG4IM/html/inline_umlgraph_1.pu
Preprocessor Error: Cannot include /Users/andydent/dev/touchgramdesign/doxygeneratedTG4IM/html/handDrawnStyle.iuml
Error line 2 in file: /Users/andydent/dev/touchgramdesign/doxygeneratedTG4IM/html/inline_umlgraph_1.pu
Some diagram description contains errors
error: Problems running PlantUML. Verify that the command 'java -jar "/Library/Java/Extensions/plantuml.jar" -h' works from the command line. Exit code: 1

This is using the configuration setting 这是使用配置设置

PLANTUML_INCLUDE_PATH = ./iumltToCopy

Sharper eyes than mine (at the time) noticed the extra character in the path iuml t ToCopy 锐利的眼睛比我(当时)发现的路径中多余的字符iuml 牛逼 ToCopy

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM