-
Notifications
You must be signed in to change notification settings - Fork 113
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
feat: add support for plantuml generated diagrams #1509
Conversation
f30e449
to
163b2d0
Compare
Codecov Report
@@ Coverage Diff @@
## main #1509 +/- ##
==========================================
+ Coverage 79.95% 80.10% +0.15%
==========================================
Files 93 94 +1
Lines 9711 9898 +187
Branches 2382 2439 +57
==========================================
+ Hits 7764 7929 +165
- Misses 1502 1515 +13
- Partials 445 454 +9
|
Nice! Will it be possible to produce puml-files (or just final images)? |
@dalito Thanks! I've implemented it the same way as the yUML generator. If you don't pass the option |
For backwards compatibility reasons I've kept the |
@Silvanoc: thank you for your work on this! I didn't know about the plantuml project before this, but it looks like another tool with UML diagram generation capabilities. Currently, the de facto tool that we're using within the linkml framework to generate/render UML diagrams is mermaid. The only kind of diagrams that we are rendering as part of the web documentation generator (gen-doc/docgen.py) at the moment are class diagrams (granted showing minimal relationship information, simply because we haven't prioritized it enough to improve the level of detail it shows). I have a couple of questions for you -
There's also an ER diagram generator in the framework: https://github.com/linkml/linkml/blob/main/linkml/generators/erdiagramgen.py |
The |
I'm aware of it and I'm not trying to provide here a replacement for it, but offering an alternative with some advantages when talking about top-level diagrams for huge schemas.
They are very similar WRT the diagrams that you can generate and their features. So WRT this question I wouldn't say that PlantUML has any remarkable advantage.
The main difference is that Mermaid is client generated on visualization (on the browser) and PlantUML is generating a diagram on build-time. Build-time diagram generation has a couple of advantages:
|
Even better, I can remove the changes to that file from the patch 👍 |
163b2d0
to
224f697
Compare
@sujaypatil96 - FYI ,with sphinxcontrib.plantuml the plantuml diagrams can be rendered from *-puml files as svg (or other formats) and embedded in the docs. But there are probably no strong arguments for swtiching linkml-docs. However, for users like myself that prefer plantuml this PR would be a nice addition. |
@sujaypatil96 WRT the deprecation of
Additionally, I'm miserably failing to the the top-level UML with Even with ER-Diagram I'm failing and I don't really know why. If I copy the result from the Markdown to an online editor, it's being properly rendered. But not on my generated pages. |
@sujaypatil96 can you give an update on @Silvanoc's comments above? I think the option to have plantuml as an optional output is most welcome |
@Silvanoc: yup, sorry the documentation's been so far behind. We've updated the linkml docs to capture the team's current recommendations on markdown documentation generation here: https://linkml.io/linkml/generators/markdown.html That being said, based on @dalito and @cmungall's suggestions it would definitely be a nice option to have the markdown documentation generator render either Mermaid or plantuml diagrams in the generated web docs. The way you've developed it currently (as a separate module It would be nice if we could have unit tests for this generator. There's some documentation in our contributor guidelines: https://linkml.io/linkml/contributing/contributing.html#linkml-testing-framework, but I'm happy to work on this with you. |
I plan to add unit tests. But as of now I have higher prio tasks in an ongoing project. |
Marked as draft because adding unittests and fixing issues detected adding the tests. |
1727192
to
cb4067c
Compare
@sujaypatil96 now the unit tests are also in place. The GitHub pipelines are failing only due to the flaky codecov. |
@Silvanoc: apologies for the late review on this PR, I/the team got caught up with other priorities and this sort of slipped through the cracks. We're bringing it back onto the front burner, and want to get this merged in at the earliest. Thank you for adding tests for your generator. I cloned your fork of the repo, switched over to the branch where you have the plantUML generator and generated a UML visualization for the kitchen_sink.yaml schema, which is the test schema that most of our generators use. It did a fantastic job of generating a UML diagram. I checked the diagrams generated by both your generator, as well as the existing yUML generator for feature parity and I saw that everything checked out nicely. The reason why GitHub Actions is complaining right now on this PR is because you have some upstream changes that you need to bring into your fork: Silvanoc#1, and doing so will get rid of the |
Signed-off-by: Silvano Cirujano Cuesta <silvano.cirujano-cuesta@siemens.com>
Add some basic unit tests for the PlanUML code generator. As of now SVG diagram generation is not being tested. Signed-off-by: Silvano Cirujano Cuesta <silvano.cirujano-cuesta@siemens.com>
cb4067c
to
9fab2b9
Compare
No problem, I appreciate very much your effort to process all PRs. It's normal that those that are not in any critical path are left behind for a while.
@sujaypatil96 I've noticed that your PR was equivalent to rebasing onto you upstream |
Great! rebasing works just as well, in fact it's better because it preserves linear git history. Merging your PR in 🚀 |
hi @Silvanoc and @sujaypatil96 !
|
@VladimirAlexiev I like your proposal, please send a PR with the proposal |
@Silvanoc Why do you use Kroki and not https://www.plantuml.com/plantuml/ ? Unlike kroki, that one always has the very latest version of plantuml. kroki_server: Optional[str] = "https://kroki.io" |
|
@VladimirAlexiev I use Kroki in order to support self-hosted diagram generators. That is in fact what we use in our company. |
@VladimirAlexiev see also #1956 for plantuml-related problems/plans. |
Adding an alternative UML generator. The advantage of this proposal over the existing one (YUML) is that it enables the usage of a service that can be self-hosted and doesn' have any license fees.
The source code is a modified version of the YUML generator.