ietf-tools / xml2rfc

Generate RFCs and IETF drafts from document source in XML according to the IETF xml2rfc v2 and v3 vocabularies
https://ietf-tools.github.io/xml2rfc/
BSD 3-Clause "New" or "Revised" License
69 stars 38 forks source link

Hardwired term "Part" #652

Open ietf-svn-bot opened 3 years ago

ietf-svn-bot commented 3 years ago

type_defect | by cabo@tzi.org


The current code seems to assume an xref with an @relative always goes to a "Part" if not a "Section" or "Appendix". The correct word in my test case would be "subregistry".

Test case:

<xref section="senml-features" sectionFormat="of" target="IANA.senml" relative="#senml-features"/>

➔ [TXT, HTML]

   Part senml-features of [IANA.senml]

   <a href="http://www.iana.org/assignments/senml#senml-features" class="relref">Part senml-features</a> of [<a href="#IANA.senml" class="xref">IANA.senml</a>]

Code:

File: writers/html.py
2809:116:            label = 'Section' if section[0].isdigit() else 'Appendix' if re.search(r'^[A-Z](\.|$)', section) else 'Part'
File: writers/text.py
4706:116:            label = 'Section' if section[0].isdigit() else 'Appendix' if re.search(r'^[A-Z](\.|$)', section) else 'Part'

Issue migrated from trac:652 at 2022-02-08 07:16:08 +0000

ietf-svn-bot commented 3 years ago

@julian.reschke@gmx.de commented


That looks like a request for a new feature to me.

ietf-svn-bot commented 3 years ago

@cabo@tzi.org commented


Can you explain the provenance of the term "Part"? That large unit inside a document is rarely what is being referenced in, say, a W3C Rec.

ietf-svn-bot commented 3 years ago

@cabo@tzi.org commented


xml2rfc doc says:

If the reference is not an RFC or Internet-Draft that is in the v3 format, the element needs to have a "relative" attribute; in this case, the value of the "section" attribute is used to render the text of the external link.

Clearly, prepending the word "Part " before the value of the section attribute is a form of "using" the latter, but I'd consider this a deviation from the documentation. Maybe that word means something different to you.

ietf-svn-bot commented 3 years ago

@julian.reschke@gmx.de commented


Note that you should be able to use sectionFormat="bare" to suppress any defaults.

ietf-svn-bot commented 3 years ago

@julian.reschke@gmx.de commented


The issue here is that the processor has no way to determine the correct term unless it is indeed a section or appendix number.

FWIW, other use cases would be linking to chapters, figures, or tables.

A generic syntax that does not require bigger changes to the grammar would allow the author to exactly specify the text to be used.

For instance, for your use case:

so a quoted string inside the section attribute would indicate that the contents should be used verbatim.

(but in any case, this is a new feature and thus should be discussed on the v3 github)

ietf-svn-bot commented 3 years ago

@rjsparks@nostrum.com _changed status from new to under_review_