-
Notifications
You must be signed in to change notification settings - Fork 17
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
Mermaid Diagram Support #134
Mermaid Diagram Support #134
Conversation
Per the docs from the template repo we use, we need to enable this explicitly by adding the proper npm configuration and it will just work. https://github.com/martinthomson/i-d-template/blob/c448265276fd30235326955c459fccf28f7bc364/doc/TOOLS.md?plain=1#L72-L75
Ugh, you need puppeteer for this? It will be enjoyable for all @OR13 (GitHub CI will be ok, others will need to configure Chrome for local draft building, I forgot this fact). |
If martinthomson/i-d-template#417 is reviewed and merged, this will be included in the container image underlying the v1m variant of the associated i-d-template@v1m template version and allow ietf-wg-scitt to use Mermaid diagrams in the WG's drafts.
Remove test animated SVG file to see if the updated container defined in the martinthomson/i-d-template GHA in our workflow works now.
8f0fcdc
to
4d9181a
Compare
We were not doing this correctly, and the kramdown-rfc maintainer told me how we can do this with IAL arguments beneath the Mermaid code block in the referenced comment below. cabo/kramdown-rfc#217 (comment) Instructions from mermaid-cli are below. https://github.com/mermaid-js/mermaid-cli/blob/f0a90b86392d0fc047db78ad169db015dc990e0d/docs/linux-sandbox-issue.md#L3
4d9181a
to
fcbcad0
Compare
I presume @OR13 stopped caring long ago, but if I figure a way to clean up the actual SVG output this might be usable and have general appeal amongst IETF WG authors, but the result has been a nice nothing burger in the end. I got it to work, then this from *** [svgcheck:] ../../tmp/kramdown-rfc20231207-155-lgaec1:1: Style property 'max-width' removed
*** [svgcheck:] ../../tmp/kramdown-rfc20231207-155-lgaec1:1: Style property 'background-color' removed
*** [svgcheck:] ../../tmp/kramdown-rfc20231207-155-lgaec1:1: Style property 'text-anchor' promoted to attribute
*** [svgcheck:] ../../tmp/kramdown-rfc20231207-155-lgaec1:1: Style property 'font-size' promoted to attribute
*** [svgcheck:] ../../tmp/kramdown-rfc20231207-155-lgaec1:1: Style property 'font-weight' promoted to attribute
*** [svgcheck:] ../../tmp/kramdown-rfc20231207-155-lgaec1:1: Style property 'text-anchor' promoted to attribute
*** [svgcheck:] ../../tmp/kramdown-rfc20231207-155-lgaec1:1: Style property 'font-size' promoted to attribute
*** [svgcheck:] ../../tmp/kramdown-rfc20231207-155-lgaec1:1: Style property 'font-weight' promoted to attribute
*** [svgcheck:] ERROR: File does not conform to SVG requirements
lib/trace.sh draft-ietf-scitt-architecture.txt -s xml2rfc-txt xml2rfc -q --rfc-base-url https://www.rfc-editor.org/rfc/ --id-base-url https://datatracker.ietf.org/doc/html/ --cache=/github/workspace/.refcache --text --no-pagination draft-ietf-scitt-architecture.xml -o draft-ietf-scitt-architecture.txt
draft-ietf-scitt-architecture.xml(2016): Error: Invalid attribute font-weight for element text, at /rfc/back/section[1]/artset/artwork[1]/*/*[1]/*[2]
draft-ietf-scitt-architecture.xml(2024): Error: Invalid attribute font-weight for element text, at /rfc/back/section[1]/artset/artwork[1]/*/*[2]/*[2]/*[2]
/github/workspace/draft-ietf-scitt-architecture.xml(10): Error: Invalid document before running preptool.
Unable to complete processing draft-ietf-scitt-architecture.xml
make[1]: *** [lib/main.mk:116: draft-ietf-scitt-architecture.txt] Error 1
lib/trace.sh draft-ietf-scitt-architecture.html -s xml2rfc-html xml2rfc -q --rfc-base-url https://www.rfc-editor.org/rfc/ --id-base-url https://datatracker.ietf.org/doc/html/ --cache=/github/workspace/.refcache --html --css=lib/v3.css --metadata-js-url=/dev/null draft-ietf-scitt-architecture.xml -o draft-ietf-scitt-architecture.html
draft-ietf-scitt-architecture.xml(2016): Error: Invalid attribute font-weight for element text, at /rfc/back/section[1]/artset/artwork[1]/*/*[1]/*[2]
draft-ietf-scitt-architecture.xml(2024): Error: Invalid attribute font-weight for element text, at /rfc/back/section[1]/artset/artwork[1]/*/*[2]/*[2]/*[2]
/github/workspace/draft-ietf-scitt-architecture.xml(10): Error: Invalid document before running preptool.
Unable to complete processing draft-ietf-scitt-architecture.xml
make[1]: *** [lib/main.mk:111: draft-ietf-scitt-architecture.html] Error 1
make[1]: Target 'latest' not remade because of errors.
draft-ietf-scitt-architecture.md has no newline on the last line
*** Run 'make fix-lint' to automatically fix some errors
make[1]: *** [lib/main.mk:199: lint-whitespace] Error 1
make[1]: Target 'lint' not remade because of errors.
rm draft-ietf-scitt-architecture.xml
make: *** [lib/main.mk:16: all] Error 2 Et fin. 🤦 |
It turns out it's easier to learn aasvg, than it is to get mermaid to work |
The main challenge is we will need to "transmogrify" (to be a smart alec) the resulting SVG, but I too see the appeal. I am closing here but as a side project for when core project work is hard kind of routine I will look into this, but it is not in scope for upstream But again, not in scope for convo here. More to follow and I will reach out if/when I make progress. |
Per the docs from the template repo we use, we need to enable this explicitly by adding the proper npm configuration and it will just work.
https://github.com/martinthomson/i-d-template/blob/c448265276fd30235326955c459fccf28f7bc364/doc/TOOLS.md?plain=1#L72-L75