Re: [Rfc-markdown] SVG diagrams for slides

Michael Richardson <mcr@sandelman.ca> Sun, 24 July 2022 14:18 UTC

Return-Path: <mcr@sandelman.ca>
X-Original-To: rfc-markdown@ietfa.amsl.com
Delivered-To: rfc-markdown@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8ED31C18872F for <rfc-markdown@ietfa.amsl.com>; Sun, 24 Jul 2022 07:18:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.91
X-Spam-Level:
X-Spam-Status: No, score=-1.91 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ju5JWCr4ro2Z for <rfc-markdown@ietfa.amsl.com>; Sun, 24 Jul 2022 07:18:37 -0700 (PDT)
Received: from relay.sandelman.ca (relay.cooperix.net [IPv6:2a01:7e00:e000:2bb::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EEC93C18872D for <rfc-markdown@ietf.org>; Sun, 24 Jul 2022 07:18:36 -0700 (PDT)
Received: from dooku.sandelman.ca (dhcp-886b.meeting.ietf.org [31.133.136.107]) by relay.sandelman.ca (Postfix) with ESMTPS id 930111F448; Sun, 24 Jul 2022 14:18:34 +0000 (UTC)
Received: by dooku.sandelman.ca (Postfix, from userid 179) id C89751A0383; Sun, 24 Jul 2022 10:18:32 -0400 (EDT)
From: Michael Richardson <mcr@sandelman.ca>
To: Carsten Bormann <cabo@tzi.org>
cc: rfc-markdown@ietf.org
In-reply-to: <2E0491A4-C4C2-456D-B566-17BC440ADE00@tzi.org>
References: <63259.1658625940@dooku> <2E0491A4-C4C2-456D-B566-17BC440ADE00@tzi.org>
Comments: In-reply-to Carsten Bormann <cabo@tzi.org> message dated "Sun, 24 Jul 2022 03:44:12 +0200."
X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 26.3
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Date: Sun, 24 Jul 2022 10:18:32 -0400
Message-ID: <9063.1658672312@dooku>
Archived-At: <https://mailarchive.ietf.org/arch/msg/rfc-markdown/6wZQjXzAZhZPPNejQ75TtqISA_Y>
Subject: Re: [Rfc-markdown] SVG diagrams for slides
X-BeenThere: rfc-markdown@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "rfc-markdown is a discussion list for people writing I-Ds and RFCs in Markdown and the authors of the tools used for that." <rfc-markdown.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/rfc-markdown>, <mailto:rfc-markdown-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/rfc-markdown/>
List-Post: <mailto:rfc-markdown@ietf.org>
List-Help: <mailto:rfc-markdown-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rfc-markdown>, <mailto:rfc-markdown-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Jul 2022 14:18:42 -0000

Carsten Bormann <cabo@tzi.org> wrote:
    > On 24. Jul 2022, at 03:25, Michael Richardson <mcr+ietf@sandelman.ca>
    > wrote:
    >> 
    >> 
    >> Is there an obvious way to get .SVG file out of kdrfc for each diagram
    >> that was up-converted from markdown?  Because SVG into a ODP/PDF/PPT
    >> makes more sense than raster.

    > What do you want to do?

Make a slide with the same diagram.

    >> I can attempt to extract it out of the XML, but I feel that there
    >> should be a better way.

    > I’m pretty sure that running a small XPath snippet is the easiest way
    > to do this.

okay.

    > Of course, you also can read the memoized results from REFCACHEDIR, but
    > that structure is tied to a specific kramdown-rfc version and might
    > change frequently (although it hasn’t for a while).  [I probably should
    > write these out in CBOR and not in Ruby’s Marshal.dump…]

okay,

    > #!/usr/bin/env ruby require 'rexml/document'

    > d = REXML::Document.new(ARGF)

    > REXML::XPath.each(d.root, "//svg:svg", {"svg" =>
    > "http://www.w3.org/2000/svg"}) do |x| puts x.to_s[0..200] end

Thank you.
I could put that into the makefile.