bafolts / tplant

Typescript to plantuml
https://segmentationfaults.com/tplant/default.html
GNU General Public License v3.0
266 stars 34 forks source link

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

Open fuhrmanator opened 1 year ago

fuhrmanator commented 1 year ago

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.

bafolts commented 1 year ago

@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?

fuhrmanator commented 1 year ago

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 commented 1 year ago

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).

bafolts commented 1 year ago

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

fuhrmanator commented 1 year ago

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