tplant icon indicating copy to clipboard operation
tplant copied to clipboard

Add support for an !include file (optional) that would have settings

Open fuhrmanator opened this issue 11 months ago • 5 comments

I want to use this in a CI on Github to create PlantUML documentation of my API. But I don't want to see all the methods or attributes in the diagrams. I'd like to insert a line hide members. But maybe I also want to hide circle or other customizations. I don't want to hack something with sed (but I will probably end up doing that).

It would be cool if tplant had an option -config <includefile> that would include the file just after the @startuml that is generated.

fuhrmanator avatar Jul 28 '23 21:07 fuhrmanator

@fuhrmanator this tool is proving popular. Problem is I don't use plantuml that often and I am not too familiar with it. Can you provide sample input, output, and how you would provide the option?

bafolts avatar Jul 28 '23 21:07 bafolts

Here's an example (the tplant tool would have to generate the !include line):

@startuml
!include customizations.puml
...
@enduml

A customizations.puml could be like:

hide members
skinparam style strictuml

So, the command could be tplant --customizations customizations.puml ...

fuhrmanator avatar Jul 29 '23 00:07 fuhrmanator

Basically, it's an optional hook to allow custom plantuml commands (any) from a specified file to be inserted after the line of @startuml. PlantUML has the !include feature already; tplant just has to write that one line (it doesn't need to even check if the file exists).

fuhrmanator avatar Jul 29 '23 03:07 fuhrmanator

Makes sense to me. I may try to get PR ready for this but have limited time over next few weeks.

bafolts avatar Jul 31 '23 22:07 bafolts

Nothing urgent! I hacked a solution on my CI, if you're curious:

https://github.com/fuhrmanator/FamixTypeScriptImporter/blob/acb4c04d488a87ed67f74e082f81333633b11255/.github/workflows/node.js.yml#L38-L43

fuhrmanator avatar Aug 01 '23 02:08 fuhrmanator