cabo/kramdown-rfc

Updating optional and default arguments for mermaid-cli usage

Closed this issue · 5 comments

Hello, @cabo and friends. Great tool, nice work. It has been a bit since I have dug into a Ruby project, but I would like to help advance the current state of Mermaid usage.

Re the details in martinthomson/i-d-template#416 (comment), it seems I need to override some arguments kramdown-rfc uses with mmdc when running in a container or make a more invasive change to the upstream i-d-template repo. So I am here to further Option 2 as I outlined there, it seems this is where the change needs to be. I see how mmdc is run now and to contrast how you pass arguments to aasvg with a default constant. So on that note, I would like to add optional argument overrides Mermaid so I can pass in a configuration file (mmdc -p puppeteer-config.json ...).

Are you amenable to that? I will draft a PR but did not know if that is what you recommend. Thanks again.

cabo commented

You can put additional options into the IAL attribute svg-options.

~~~ svg
{::include foo.svg}
~~~
{: svg-options="--bar"}

(typed from memory)

Ironically, I just read the last commit with updates to those docs but I did not understand them in the context of commands. I seem to have misread the code in the mermaid closure before. 🤦

I will test that then close this as a PEBKAC Issue later tonight or worst case tomorrow. Thanks for the prompt reply.

The correct syntax was close but I had to reconsider the artwork prefix.

~~~ mermaid
sequenceDiagram
    participant Issuer
~~~
{: artwork-svg-options="-p puppeteer-config.json"}

It worked but there are other stability challenges you and others mentioned in this repository's docs and elsewhere. I will close.

cabo commented

For the record -- can you attach the puppeteer-config.json that worked for you?
(I think we'll fix some of the SVG madness in time.)

Ah, it's right there in the link: aj-stein-nist/draft-ietf-scitt-architecture@fcbcad0

For the record -- can you attach the puppeteer-config.json that worked for you? (I think we'll fix some of the SVG madness in time.)

Correct. It is in the branch. I closed the issue as it pertains to that draft because I will have to sort out the write SVG requirements in svgcheck and handle that later. You are knowledgeable and kramdown-rfc will be the likely driver, I will probably be back with questions. :-)