jenkins.io icon indicating copy to clipboard operation
jenkins.io copied to clipboard

Support for Mermaid diagrams

Open basil opened this issue 2 years ago • 1 comments
trafficstars

Suggestion

In #6809 I tried to include a Gantt chart via Mermaid and asciidoctor-diagram, but it wasn't practical. Even after adding asciidoctor-diagram to Gemfile and after adding @mermaid-js/mermaid-cli to package.json, I still ran into a number of issues. For one, there was no straightforward way to enable the asciidoctor-diagram extension from Awestruct. But even after hacking around this, I ran into a fundamental problem. asciidoctor-diagram requires the mmdc tool from mermaid-cli to be installed when it is running, but that is a JavaScript (not Ruby) package, and our build currently has separate stages and separate Docker environments for JavaScript and Ruby, so each environment is unavailable from the other. This does keep the build nice and simple by allowing us to use unmodified upstream Docker images, in contrast to having to maintain an omnibus build environment ourselves with every possible tool installed. But it also means that the Ruby environment running asciidoctor has no access to the JavaScript environment with mermaid-cli.

I worked around this issue in #6809 by running asciidoctor-diagram locally with its SVG backend to generate rendered SVG versions of the Gantt charts, which I included in that PR. But in the future it would be nice to be able to automatically render Mermaid markup. This would likely involve some deeper changes to the build.

Links

No response

basil avatar Nov 03 '23 19:11 basil