Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I custom PlantUML style by options? #5

Closed
hxhac opened this issue Nov 7, 2023 · 6 comments
Closed

Can I custom PlantUML style by options? #5

hxhac opened this issue Nov 7, 2023 · 6 comments

Comments

@hxhac
Copy link

hxhac commented Nov 7, 2023

styles like ISAAC, Deep Sea, Graytone...etc

@Airkro
Copy link
Member

Airkro commented Nov 9, 2023

嵌入式文档使用 Kroki 这种在线服务,对服务本身进行配置,或API传递自定义选项不是好方法。

建议将自定义选项写成代码的一部分,这样你的图表信息是一体便携的,前提是该图表库支持在代码里写选项。

以 PlantUML 为例,使用 !theme 语法:

!theme cerulean

rectangle "Main" {
  (main.view)
  (singleton)
}
...

@Airkro
Copy link
Member

Airkro commented Nov 9, 2023

Embedded documentation Using an online service like Kroki, configuring the service itself, or API passing custom options is not a good idea.
It is recommended that custom options be written as part of the code so that your diagram information is portable in one piece, provided that the diagram library supports writing options in code.
Take PlantUML for example, using !theme syntax:

!theme cerulean

rectangle "Main" {
  (main.view)
  (singleton)
}
...

@hxhac
Copy link
Author

hxhac commented Nov 9, 2023

kroki 本身应该是支持 theme 的

是不是 remark-kroki 只需要把 kroki 本身提供的 theme配置暴露出来就可以了呢

我没有自建,直接使用的官方服务,所以没办法自己配置 kroki 服务端。

@Airkro
Copy link
Member

Airkro commented Nov 9, 2023

无法理解你的问题,只要在图表文本中加入 !theme xxx 就可以使自带的主题生效,这属于 PlantUML 自带的功能,与 kroki/remark-kroki 无关。

实测自带主题,远程主题都能生效,所以现在是哪里不满足你的场景?

@Airkro
Copy link
Member

Airkro commented Nov 9, 2023

ISAAC, Deep Sea, Graytone 是 PlantUML-styler 的私有实现,PlantUML 并不支持

@hxhac
Copy link
Author

hxhac commented Nov 9, 2023

这样啊,那我懂了,我以为是kroki自己实现的,谢谢你的解答

@hxhac hxhac closed this as completed Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants