mmarkdown / mmark

Mmark: a powerful markdown processor in Go geared towards the IETF
https://mmark.miek.nl
Other
480 stars 45 forks source link

ref to BCP #209

Closed miekg closed 11 months ago

miekg commented 11 months ago

mail from Carsten, would be good to mirror this here:

Up to now, it was really hard to reference into a referencegroup (STD or BCP reference), as that reference could possibly contain multiple RFCs, and one would need to be explicit which one was meant with the section reference.

For RFC 9485, the RPC devised a way to express in RFCXML section references into RFCs that are in reference groups. This convention is now supported by kramdown-rfc.

New syntax: RFC8949@STD94 (Single RFC @ Reference Group)

This can be used for section references:

See {{Section 10 of RFC8996@BCP195}}. See {{Section 10 ("Security Considerations") and 11 ("Privacy Considerations") of RFC8996@BCP195}}.

Nicknames (-xxx) and norm/inform flags only work to the right side of an @:

See {{Appendix D of RFC8949@!STD94}}. See {{Appendix D of RFC8949@-cbor}}.

The left hand side of an @ MUST be an RFC number; breakage otherwise. (Indirection would be great for the left hand side; this is for further study.)

For completeness, the @ syntax somewhat redundantly also works for non-section references into reference groups:

See {{RFC8949@?STD94}}. See {{RFC8949@STD94}}.

Grüße, Carsten

miekg commented 11 months ago

xml2rfc --unprep rfc9485.xml

and looking at the generated xml:

<t>While technically out of the scope of this specification, Section <xref target="RFC3629" section="10" sectionFormat="bare"> "Security Considerations"</xref> of RFC 3629 <xref target="STD63"/> applies to implementations.
Particular note needs to be taken of the last paragraph of Section <xref target="RFC3629" section="3" sectionFormat="bare"> "UTF-8 definition" </xref> of RFC 3629 <xref target="STD63"/>; an I-Regexp implementation may need tomitigate limitations of the platform implementation in this regard.</t>

i don't see the special syntax being used.

miekg commented 11 months ago

oh, it generates the entirety of this:

 <xref target="RFC3629" section="3" sectionFormat="bare"> "UTF-8 definition" </xref> of RFC 3629 <xref target="STD63"/>