Subject: Re: [xml2rfc] SVG and Kramdown

From: Brian E Carpenter <[email-masked]>
Date: Fri, 3 Jul 2020 09:10:07 +1200

On 01-Jul-20 17:10, Carsten Bormann wrote:
> On 2020-07-01, at 07:00, Brian E Carpenter <[email-masked]> wrote:
>>
>> OK, I've seen the draft but it didn't help me one bit.
>>
>> What do I write in a kramdown source to embed SVG artwork, and is it possible to embed it in-line, or must it be an external file?
> 
> See the example I just sent.  You can write the XML right into the kramdown source.  This *is* a bit unwieldy, so try {::include fn} if you want to avoid the prepping stage (a simple -v2v3 conversion will then do).

Right, but that of course creates difficulty when using the web service tools.

> What tool do you use to generate the SVG?

Sadly, this is a horror story. The originals are in LibreOffice .odp format, and LibreOffice produces SVG with embedded ECMASCRIPT (I think triggered by circles in the diagrams). That is of course strictly forbidden by RFC7996. So I had to generate GIF from LibreOffice, convert GIF to SVG with convertio.co, manually massage the SVG to remove three troublesome elements**, and voila: RFC7996-compatible SVG.

** delete 'stroke="none"', which svgcheck dislikes, and delete width= and height=, which break scaling.

I think LibreOffice is a hopeless case, and we should advise people not to use it as a source.

Thanks
    Brian

> If it is generated from plaintext input, I might want to add support for it.  Goat, ditaa, plantuml, and mscgen are “supported" right now, with potential surprises in the code that turns the output into bi-level black-and-white.
> 
> (I’m fighting with mermaid right now — svgcheck gives me a lot of black rectangles; I probably have to further complicate my pipeline to actually apply the styles left by mermaid.)
> 
> Grüße, Carsten
> 
>