[Rfc-markdown] 1.4.7..1.4.10: More section reference support, BCP/STD references

Carsten Bormann <cabo@tzi.org> Thu, 06 May 2021 07:54 UTC

Return-Path: <cabo@tzi.org>
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 C403A3A16A3 for <rfc-markdown@ietfa.amsl.com>; Thu, 6 May 2021 00:54:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.819
X-Spam-Level:
X-Spam-Status: No, score=-1.819 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, TRACKER_ID=0.1, URIBL_BLOCKED=0.001] autolearn=ham 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 srQHvv9Amixm for <rfc-markdown@ietfa.amsl.com>; Thu, 6 May 2021 00:54:14 -0700 (PDT)
Received: from gabriel-vm-2.zfn.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2960A3A169F for <rfc-markdown@ietf.org>; Thu, 6 May 2021 00:54:14 -0700 (PDT)
Received: from client-pool2-157.vpn.uni-bremen.de (client-pool2-157.vpn.uni-bremen.de [134.102.48.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-vm-2.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4FbQnv5CdwzyRY; Thu, 6 May 2021 09:54:11 +0200 (CEST)
From: Carsten Bormann <cabo@tzi.org>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-Mao-Original-Outgoing-Id: 641980451.228792-39f76b760971160a768a37d7f74add0f
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.6\))
Date: Thu, 06 May 2021 09:54:11 +0200
Message-Id: <89D5F4D0-76A4-4110-A3D0-2DC02A156151@tzi.org>
To: RFC Markdown <rfc-markdown@ietf.org>
X-Mailer: Apple Mail (2.3608.120.23.2.6)
Archived-At: <https://mailarchive.ietf.org/arch/msg/rfc-markdown/uoRbaWoaB01GgSXZFcKMC-z-RJc>
Subject: [Rfc-markdown] 1.4.7..1.4.10: More section reference support, BCP/STD references
X-BeenThere: rfc-markdown@ietf.org
X-Mailman-Version: 2.1.29
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: Thu, 06 May 2021 07:54:19 -0000

A few more v3 additions (again, mostly thanks to Martin Thomson):

# Allow !?- in section references

One could always write {{?RFC1149}} to add an informative reference, or {{!RFC8610}} for a normative reference, without needing to touch the YAML metadata.  Also, with YAML metadata of the form...

normative:
  RFC8610: cddl

...one could write {{-cddl}} to have an indirection to painlessly move to a revised RFC without updating all references in the text.

New in 1.4.10: All three syntaxes are now available for Section references as well:

> The Extended Diagnostic Notation is defined in {{Appendix G of !RFC8610}}.


# Handle Sections+Appendices, enable (markdown specified) link text in xref

Section References have been further enhanced; you can now write monsters such as:

> This uses the definitions in {{Sections 1 (Introduction), 2 (The Style of Data Structure Specification), and 3 (Syntax) and Appendices B (ABNF) and G (Extended Diagnostic Notation) of !RFC8610 (CDDL)}}.

(The error handling is a but crusty, though, and you can’t have a comma before the “and Appendices".)
The text in parentheses becomes link text (which is not special in TXT format).

Result in TXT is a bit boring:
   This uses the definitions in Sections 1 (Introduction), 2 (The Style
   of Data Structure Specification), and 3 (Syntax) and Appendices B
   (ABNF) and G (Extended Diagnostic Notation) of CDDL [RFC8610].
The HTML has all the links.
(I have copied the XML below (*) for your amusement…  
You will be excused if you try to write this by hand and make a mistake.)

The text snippets in parentheses can use markdown, but there is a bit xml2rfc cruftiness (**) in the way before that can be fully used.

# Enable BCP and STD references 

{{STD0094}} or {{?BCP190}} etc.

A little limitation is that you need to be consistent with the leading zeroes; you can’t have {{STD94}} and {{STD0094}} in the same document.

This feature is based on an experimental bibxml server that may or may not always be available.
If that is a problem, or you want to support offline use, a new (rather slow) command…

kramdown-rfc-cache-subseries-bibxml

…can be used to build a local cache that is equivalent to the content of that server (stored in you xml2rfc/kramdown-rfc cache directory such as ~/.cache/xml2rfc).
(The command does not use the experimental server but goes directly to the sources, so it is a bit slow particularly when filling the cache.  Couple of minutes…)


As usual, update with

  gem update
or, more specifically
  gem update kramdown-rfc2629

Please keep the feedback (***) flowing!

Grüße, Carsten

(*)
<t>This uses the definitions in Sections <xref target="RFC8610" section="1" sectionFormat="bare">Introduction</xref>, <xref target="RFC8610" section="2" sectionFormat="bare">The Style of Data Structure Specification</xref>, and <xref target="RFC8610" section="3" sectionFormat="bare">Syntax</xref> and Appendices <xref target="RFC8610" section="B" sectionFormat="bare">ABNF</xref> and <xref target="RFC8610" section="G" sectionFormat="bare">Extended Diagnostic Notation</xref> of <xref target="RFC8610">CDDL</xref>.</t>

(**) https://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/636

(***) https://github.com/cabo/kramdown-rfc2629/issues