Stream: IG creation
Topic: PlantUML integration documentation
Max Masnick (Sep 22 2021 at 13:55):
Is there documentation for the PlantUML integration with the IG Publisher? I didn't see anything at https://confluence.hl7.org/display/FHIR/IG+Publisher+Documentation or elsewhere on Confluence.
I'm looking for a resource that describes how to get PlantUML to run locally (I believe you need to install graphviz
...not sure if there are other dependencies), where to put the UML files, etc.
If this doesn't exist I can take a pass at writing it...just want to make sure I'm not duplicating effort first.
Josh Mandel (Sep 22 2021 at 13:58):
This came up yesterday in an out-of-band discussion with @Carl Anderson and @Eric Haas -- we didn't find anything on confluence.
Carl Anderson (Sep 22 2021 at 13:59):
I'm interested in helping with this effort, too
Gino Canessa (Sep 22 2021 at 14:00):
Hi Max, I just ran through a test (yesterday), this worked locally for a FSH-based IG (subscriptions backport):
Install PlantUML:gem install jekyll-plantuml
(after Jekyll is already installed)- Create the
<root>/input/images-source
directory - Add a new file:
<root>/input/images-source/diagram.plantuml
- In a markdown file (in
/input/pages
), insert the result file:{%include diagram.svg%}
After running _genonce.bat
everything looks right, except for an extra line of XML that I need to track down.
Josh Mandel (Sep 22 2021 at 14:06):
Hmm, does this work in the auto build environment? And if not... (how) are IGs using it in real life? I ask because our docker config doesn't appear to install jekyll-plantuml
, but maybe it's pulled in from elsewhere.
Max Masnick (Sep 22 2021 at 14:09):
When I set this up in docker, I just had to apt-get install graphviz
and it worked. I assume I did some homebrew thing to get graphviz
on my local system. No idea how to do this on Windows
Gino Canessa (Sep 22 2021 at 14:10):
No idea - didn't get that far =). Unfortunately, I don't remember which IGs I looked at to figure out the steps to see if they have CI builds.
Max Masnick (Sep 22 2021 at 14:11):
@Gino Canessa what happens if you don't install jekyll-plantuml
?
Josh Mandel (Sep 22 2021 at 14:11):
Cool Max -- @Jean Duteau gave us graphviz in the auto-build env back in Feb, so that must be why :-)
Gino Canessa (Sep 22 2021 at 14:12):
I was testing on Windows, so that process worked there.
I didn't actually test without installing it, one sec.
Max Masnick (Sep 22 2021 at 14:14):
I don't think the Jekyll plugin is actually necessary for the integration I was thinking of -- the IG Publisher handles the conversion of .plantuml
to .svg
, and all Jekyll does is include the .svg
with its generic support for including files in other files.
Gino Canessa (Sep 22 2021 at 14:17):
Yep - it actually isn't necessary. Still has the extra XML literal above the SVG though (<?xml version=”1.0” encoding=”UTF-8” standalone=”no”?>
).
This is on windows without graphviz.
(edit: as a note, I initially installed it due to following steps I found somewhere... would have to go back and try to figure out where)
Lloyd McKenzie (Sep 22 2021 at 15:29):
Yes, the XML declaration is on my list of things to fix. But no installation necessary. Agree that we need to add the documentation of the 'how'.
David Pyke (Sep 22 2021 at 16:16):
YOu can get rid of the XML declaration by putting <div></div> tags around the include line
Jose Costa Teixeira (Sep 22 2021 at 19:24):
PlantUML does not require graphviz for all diagram types
Jose Costa Teixeira (Sep 22 2021 at 19:24):
For sequence diagrams for example
Jose Costa Teixeira (Sep 22 2021 at 19:25):
I don't know if there are still issues with needing graphviz, but PlantUML also has another trick to avoid it
Jose Costa Teixeira (Sep 22 2021 at 19:28):
There is a directive that uses its own rendering engine (called smetana) instead of graphviz
Jose Costa Teixeira (Sep 22 2021 at 19:28):
Here's an example of that :
https://github.com/openhie/case-reporting-hiv-vn/blob/main/input/images-source/actors_transactions.plantuml
Jose Costa Teixeira (Sep 22 2021 at 19:33):
Another trick: after the image it may be best to add <br clear="all"> otherwise the text may be wrapped around the diagram
Jose Costa Teixeira (Sep 22 2021 at 19:34):
@Max Masnick I use the vscode extension for PlantUML. Alt+D and I get my diagram preview
Jose Costa Teixeira (Sep 22 2021 at 19:37):
On the extra XML: https://forum.plantuml.net/12443/remove-xml-declaration-from-svg?show=12443#q12443
Jose Costa Teixeira (Sep 22 2021 at 19:41):
I don't know what is the current plantuml version we're using, perhaps we should update
Jose Costa Teixeira (Sep 22 2021 at 19:45):
(apologies for only catching up late)
Jekyll-plantuml is not needed IMO.
Jose Costa Teixeira (Sep 22 2021 at 19:46):
@Chris Moesel I have the images-source in the empty templates I always use. Does sushi --init also create this folder?
Jose Costa Teixeira (Sep 22 2021 at 19:51):
@Lloyd McKenzie is this on sample-ig or ig-guidance?
Jose Costa Teixeira (Sep 22 2021 at 19:51):
(the examples and how-to, I mean)
Lloyd McKenzie (Sep 22 2021 at 19:51):
Examples in sample-ig and explanation of how-to in ig-guidance
Jose Costa Teixeira (Sep 22 2021 at 19:52):
Hmmmm... What if I had a cool idea of using a few PlantUML diagrams to describe the how?
Jose Costa Teixeira (Sep 22 2021 at 19:54):
Then this how-to would also use examples. I'll do this on guidance IG
Lloyd McKenzie (Sep 22 2021 at 19:58):
At the moment, I'll happily settle for documentation somewhere :)
Jose Costa Teixeira (Sep 22 2021 at 20:21):
:)
Chris Moesel (Sep 22 2021 at 20:31):
Jose Costa Teixeira said:
Chris Moesel I have the images-source in the empty templates I always use. Does sushi --init also create this folder?
Nope. sushi --init
only creates input/fsh
and input/pagecontent
. Authors need to add the other folders themselves if they want them.
Jose Costa Teixeira (Sep 25 2021 at 08:29):
I created this page to start. Please provide feedback before the PR with the Guidance-ig
http://build.fhir.org/ig/FHIR/ig-guidance/branches/plantuml/diagrams.html
Jose Costa Teixeira (Sep 25 2021 at 08:30):
@Lloyd McKenzie, @Grahame Grieve please merge or let me know if I should create the PR
Jose Costa Teixeira (Sep 25 2021 at 08:30):
(deleted)
Jose Costa Teixeira (Sep 29 2021 at 21:14):
https://github.com/FHIR/ig-guidance/pull/15
Last updated: Apr 12 2022 at 19:14 UTC