Re: [Cellar] [Tools-discuss] expressing both svg graphics and ascii-art fallback within an rfc2xml version 3 file?

Dave Rice <dave@dericed.com> Sun, 01 September 2019 22:13 UTC

Return-Path: <dave@dericed.com>
X-Original-To: cellar@ietfa.amsl.com
Delivered-To: cellar@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8A1561200CD; Sun, 1 Sep 2019 15:13:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.118
X-Spam-Level:
X-Spam-Status: No, score=-1.118 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yNjZbMx8a9S1; Sun, 1 Sep 2019 15:13:11 -0700 (PDT)
Received: from server172-3.web-hosting.com (server172-3.web-hosting.com [68.65.122.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B141912008F; Sun, 1 Sep 2019 15:13:11 -0700 (PDT)
Received: from cpe-104-162-94-162.nyc.res.rr.com ([104.162.94.162]:48842 helo=[10.0.1.3]) by server172.web-hosting.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from <dave@dericed.com>) id 1i4Y5o-0002C2-V8; Sun, 01 Sep 2019 18:13:10 -0400
From: Dave Rice <dave@dericed.com>
Message-Id: <5C1CA680-3880-4D7B-A6D5-CC28DDC940DF@dericed.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_8C6627AB-ACFA-4F7E-AC9D-9134A02895CA"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\))
Date: Sun, 01 Sep 2019 18:13:02 -0400
In-Reply-To: <7b4e6a16-0b2b-a6f9-2ae6-5b1ddd3c05f8@levkowetz.com>
Cc: Michael Richardson <mcr+ietf@sandelman.ca>, tools-discuss@ietf.org, Codec Encoding for LossLess Archiving and Realtime transmission <cellar@ietf.org>
To: Henrik Levkowetz <henrik@levkowetz.com>
References: <3AAAEED4-87A9-4F5B-9910-55BABBDBBB15@dericed.com> <16851.1567355345@dooku.sandelman.ca> <7b4e6a16-0b2b-a6f9-2ae6-5b1ddd3c05f8@levkowetz.com>
X-Mailer: Apple Mail (2.3445.104.11)
X-OutGoing-Spam-Status: No, score=-2.9
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - server172.web-hosting.com
X-AntiAbuse: Original Domain - ietf.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - dericed.com
X-Get-Message-Sender-Via: server172.web-hosting.com: authenticated_id: dave@dericed.com
X-Authenticated-Sender: server172.web-hosting.com: dave@dericed.com
X-Source:
X-Source-Args:
X-Source-Dir:
X-From-Rewrite: unmodified, already matched
Archived-At: <https://mailarchive.ietf.org/arch/msg/cellar/LBle0gt7jYZJBcq_SOto1-uRWQk>
Subject: Re: [Cellar] [Tools-discuss] expressing both svg graphics and ascii-art fallback within an rfc2xml version 3 file?
X-BeenThere: cellar@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Codec Encoding for LossLess Archiving and Realtime transmission <cellar.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cellar>, <mailto:cellar-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cellar/>
List-Post: <mailto:cellar@ietf.org>
List-Help: <mailto:cellar-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cellar>, <mailto:cellar-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 01 Sep 2019 22:13:13 -0000

Hi Henrik, Julian,

> On Sep 1, 2019, at 12:46 PM, Henrik Levkowetz <henrik@levkowetz.com> wrote:
> 
> Hi David,
> 
> Response at the bottom:
> 
> On 2019-09-01 18:29, Michael Richardson wrote:
>> 
>> {reposting to tools-discuss}
>> 
>> Hello cellar,
>> 
>> The draft of FFV1 now uses xml2rfc version 3 as defined at
>> https://tools.ietf.org/html/rfc7991
>> <https://tools.ietf.org/html/rfc7991>. Presently in the markdown source of
>> the FFV1 draft, the math is maintained in both LaTeX expressions (which are
>> converted to SVG for inclusion in the RFC XML) as well as an Ascii Art
>> representation (heavily reliant on functions defined within the draft). For
>> example: 
>> 
>> vs
>> 
>> r_{i} = floor( ( R_{i} * S_{i,C_{i}} ) / 2^8 )
>> 
>> Whether in SVG or ascii art, this data is contained by the <artwork> node in
>> rfc2xml version 3. In https://tools.ietf.org/html/rfc7991#section-2.5
>> <https://tools.ietf.org/html/rfc7991#section-2.5> it states, 
>> 
>>   Alternatively, the "src" attribute allows referencing an external
>>   graphics file, such as a vector drawing in SVG or a bitmap graphic
>>   file, using a URI.  In this case, the textual content acts as a
>>   fallback for output representations that do not support graphics;
>>   thus, it ought to contain either (1) a "line art" variant of the
>>   graphics or (2) prose that describes the included image in sufficient
>>   detail.
>> 
>> A bit later it says that SVG data may be encoded and stored within the
>> <artwork>’s @src attribute such as  
>> 
>>   o  As a data: URI, such as: <artwork type="svg" src="data:image/
>>      svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3…">
>> 
>> So from this I was hoping we could work on one draft rfc2xml version 3 file
>> that could use the SVG image data or use the ascii art as a fallback; however
>> when I try to craft the <artwork> node with both such as: 
>> 
>>   <artwork type="svg" src="data:image/svg+xml,ENCODED_SVG_MATH_IMAGE_HERE”>FALLBACK_ASCII_ART_HERE</artwork>
>> 
>> then the output “v3-plaintext” output of the conversion tool at
>> https://xml2rfc.tools.ietf.org/experimental.html
>> <https://xml2rfc.tools.ietf.org/experimental.html>, does not use the textual
>> content of the <artwork> node as a fallback but instead places a warning such
>> as 
>> 
>>   (Artwork only available as svg: No external link available, see
>>   draft-ietf-cellar-ffv1-08.html for artwork.)
>> 
>> Is it feasible (recommended?) to have one rfc2xml XML document that could be
>> a source for both plaintext formats (using an ascii art fallback) and
>> non-plaintext formats such as HTML and PDF which would use the embedded SVG
>> data?
> 
> Yes.  The specification of how to handle the text fallback in the RFC 799x
> documents was in part contradictory, and also not as extensible and easily
> editable as one could wish.  It currently looks like rfc7991bis largely will
> follow the proposal discussed on the xml2rfc-dev list earlier this year, and
> captured in the xml2rfc implementation notes draft here:
> 
> https://tools.ietf.org/html/draft-levkowetz-xml2rfc-v3-implementation-notes-09#section-3.1.1 <https://tools.ietf.org/html/draft-levkowetz-xml2rfc-v3-implementation-notes-09#section-3.1.1>
> 
> which introduces an <artset> element which can contain multiple <artwork>
> elements with different type attributes, for instance (artwork and some
> details omitted:
> 
>  <artset>
>    <artwork type="svg" src="..."/>
>    <artwork type="ascii-art" ...>
> 	# ascii art
>    </artwork>
>  </artset>
> 
> For more on this, and for a light introduction to the v3 schema, check:
> http://tools.ietf.org/src/xml2rfc/trunk/cli/doc/xml2rfc3.html#artwork-alternatives <http://tools.ietf.org/src/xml2rfc/trunk/cli/doc/xml2rfc3.html#artwork-alternatives>

Thanks, this was exactly the clarification that I needed! I see that with the <artset> use described here, that the v3-plaintext and v3-html outputs of https://xml2rfc.tools.ietf.org/experimental.html <https://xml2rfc.tools.ietf.org/experimental.html> use the appropriate <artwork> for the output. If you’re interested, my work to ‘build’ this XML from out markdown source is in https://github.com/FFmpeg/FFV1/pull/160 <https://github.com/FFmpeg/FFV1/pull/160>, and an example of <artset> in the output of this PR can be seen at https://gist.github.com/dericed/3063446119a6e5971ecad29027977073#file-draft-ietf-cellar-ffv1-08-xml-L489-L502 <https://gist.github.com/dericed/3063446119a6e5971ecad29027977073#file-draft-ietf-cellar-ffv1-08-xml-L489-L502>.

Thanks so much,
Dave Rice