xml2rfc icon indicating copy to clipboard operation
xml2rfc copied to clipboard

feature request: mark artwork/sourcecode's use of RFC 8792 line folding

Open reschke opened this issue 2 years ago • 17 comments

That would allow to enhance the display; see for instance https://www.ietf.org/archive/id/draft-ietf-httpbis-digest-headers-10.html#section-2 for how intrusive the current notes are.

reschke avatar Jun 20 '22 09:06 reschke

(I assume that this is a vocabulary request?)

Note that kramdown-rfc currently addresses folding as part of he {::include... mechanism.

Archived-At: https://mailarchive.ietf.org/arch/msg/rfc-markdown/sYIDErZ1ziwUC9E7DTGizGUoT54

The whole syntax is {::include-proc-proc... fn} where proc is one of:

  • nested: process {::include... in included files (which can again use nested, ...)
  • quote: turn included file into a block quote
  • dedent: remove common indentation (push block left until shortest indentation is 0)
  • fold[fff][left[lll]][dry]: RFC 8792 fold (to fff columns, default is 0); left-aligned continuations if left is set (lll is the indentation of left-alined continuations), dry means without legend.
  • all, last: interpret the file name as a glob and use all files/the last-sorting file with that glob.

Of course, much of this should also be possible for inline code blocks, which is a TODO.

cabo avatar Jun 20 '22 10:06 cabo

(I assume that this is a vocabulary request?)

Potentially, so that the renderers can insert the "NOTE..." automatically, and style it less intrusively.

(Of course this could be done with heuristics, which I'll try in my XSLT as a POC)

reschke avatar Jun 20 '22 10:06 reschke

I mentioned the kramdown-rfc functionality because xml2rfc might also want to provide some authoring support that would be triggered by some new vocabulary, although that might be a more radical idea.

cabo avatar Jun 20 '22 11:06 cabo

FWIW, here's a POC for rendering: https://greenbytes.de/tech/webdav/draft-ietf-httpbis-digest-headers-latest.html#rfc.section.2.p.3

reschke avatar Jun 22 '22 05:06 reschke

Proposed grammar: fold = none | end | both

martinthomson avatar Aug 17 '22 12:08 martinthomson

Good folding is way more elaborate. I prefer to do this before committing to RFCXML. (Yes, there needs to be some rendering assist, but only that.)

cabo avatar Aug 17 '22 13:08 cabo

This thread has confused me a bit, so here's my understanding of what is being asked for:

  • <artwork> needs to have a new attribute that can be used to indicate that the content of the artwork has been folded.
  • This is so that the folding does not need to be noted inside the <artwork> and can be managed by styling.
  • Use of the attribute should not trigger any automated folding inside <artwork> as that is best left to authors, it is only a note about the formatting.

So the question is then which of the following three grammar constructs is better:

  1. <artwork folded="true">
  2. <artwork format-notes="folded"> (could then be expanded to format-notes="folded,rtl" or other format hints)
  3. <artwork fold-delimeter="\"> (in case we ever use another delimeter)

JayDaley avatar Sep 13 '22 12:09 JayDaley

Proposed grammar: fold = none | end | both

@martinthomson - what would these values mean? Am I missing something here?

reschke avatar Sep 13 '22 13:09 reschke

Note that RFC 8792 has two kinds of folding (Section 7 and Section 8); which of them is being used needs to be indicated ('\' or '\\' folding).

cabo avatar Sep 13 '22 13:09 cabo

Note that the spec of this would need to update RFC 8792, Sections 7.1.1 and 8.1.1.

cabo avatar Sep 13 '22 13:09 cabo

Note that RFC 8792 has two kinds of folding (Section 7 and Section 8); which of them is being used needs to be indicated ('' or '' folding).

Which suggests that the grammar change should be <artwork fold-delimeter="\"> or something similar

JayDaley avatar Sep 13 '22 13:09 JayDaley

Note that the RFC 7991 way of naming attributes is studlyCaps (camelCase). (There are counter-examples, such as quote-title/suppress-title and subitem/fullname/colspan/rowspan, but the studlyCaps way is the dominant one.)

I would avoid monsters like "fold-delimiter" and just use "fold" anyway.

cabo avatar Sep 13 '22 14:09 cabo

FWIW, RFC 7991 uses "quoteTitle", but somebody preferred to rename it.

reschke avatar Sep 13 '22 14:09 reschke

FWIW, RFC 7991 uses "quoteTitle", but somebody preferred to rename it.

Actually, xml2rfc has both:

       attribute quoteTitle { "true" | "false" }?,
       attribute quote-title { "true" | "false" }?,

(Note that nothing specifies which one wins. The code seems to indicate kebab wins over camel. Apologies for opening this side track. We now return you to your regular programming.)

cabo avatar Sep 13 '22 14:09 cabo

If we're going to resume making changes to the v3 grammar before the RSWG weighs in, I have a quite a few I'd like to add.

jrlevine avatar Sep 13 '22 15:09 jrlevine

@reschke,

Proposed grammar: fold = none | end | both

@martinthomson - what would these values mean? Am I missing something here?

none = no folding end = RFC 8792 "\" folding with "\" only at the end of the line both = RFC 8792 "\\" folding with "\" at the end of the line followed by "\" at the start of the line

martinthomson avatar Sep 13 '22 18:09 martinthomson

Because this is a request that impacts grammar, I suggest removing the rpat label from this issue and applying the rswg label.

ajeanmahoney avatar Sep 14 '23 15:09 ajeanmahoney