Subject: [netmod] CODE BEGINS ENDS for examples ?

From: Balázs Lengyel <[email-masked]>
Date: Fri, 20 Mar 2020 17:02:26 +0000

Hello,

Is it allowed/recommended to use <CODE BEGINS> <CODE ENDS> around examples.
In my case it would be examples of XML and JSON instance data. I would find
it rather useful.

As a second step if someone could combine rfcstrip with artwork-unfolding
that would be even better.

Regards Balazs

-- 

Balazs Lengyel                    Senior Specialist
Ericsson Hungary Ltd. 

Mobile: +36-70-330-7909              email: [email-masked]

---

From: Kent Watsen <[email-masked]>
Date: Fri, 20 Mar 2020 23:01:04 +0000

Hi Balazs,

As I understand it, the <CODE BEGIN> <CODE END> blocks are not appropriate for examples. 

Examples are easily extracted from XML via `xmllint` with the “—xpath” parameter, after which the `rfcfold` script can be run.  Strongly recommend setting the “name” attribute on the <sourcecode> or <artwork> element in the XML draft.  It’s good to see that you want to do it this way, as I noticed you hand-folded the examples and I’m pretty sure I spotted what looked like might result in an undesirable unfolding artifact...

FWIW, https://pypi.org/project/xiax attempts to do all this, but I suspended that effort getting distracted with other things...

Kent // contributor

> On Mar 20, 2020, at 1:02 PM, Balázs Lengyel <balazs.lengyel=[email-masked]> wrote:
> 
> Hello,
> Is it allowed/recommended to use <CODE BEGINS> <CODE ENDS> around examples. In my case it would be examples of XML and JSON instance data. I would find it rather useful.
>  
> As a second step if someone could combine rfcstrip with artwork-unfolding that would be even better.
> Regards Balazs
>  
> -- 
> Balazs Lengyel                    Senior Specialist                       Ericsson Hungary Ltd. 
> Mobile: +36-70-330-7909              email: [email-masked] <mailto:[email-masked]>
>  
> _______________________________________________
> netmod mailing list
> [email-masked] <mailto:[email-masked]>
> https://www.ietf.org/mailman/listinfo/netmod <https://www.ietf.org/mailman/listinfo/netmod>

---

From: Balázs Lengyel <[email-masked]>
Date: Sat, 21 Mar 2020 14:56:45 +0000

Hello Kent,

First <CODE BEGIN> <CODE END> is very handy and easier to use then xmllint.

Also some people (not me) are writing RFCs without XML. SO if it acceptable to you, the RFC editor to whoever I will use <CODE...> for the examples. Is that acceptable?

Folding:

Rfcfold folds the line at a fixed 69 character length. This produces some not so nice results:

Rfcfold:

    <inline-schema>

      <modules-state xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-li\

brary">

        <module>

Manual folding:

    <inline-schema>

      <modules-state \

          xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library">

        <module>

The manual folding can keep a nice tabulation and fold the line at a word or element boundary. I know such editorial niceties are very hard to program in a script; but this is one reason to do manual folding.

I used rfcfold to unfold the acme-router-modules example and I don’t notice anything strange.

Regards Balazs

From: Kent Watsen <[email-masked]> 
Sent: 2020. március 21., szombat 0:01
To: Balázs Lengyel <[email-masked]>
Cc: [email-masked]
Subject: Re: [netmod] CODE BEGINS ENDS for examples ?

Hi Balazs,

Kent // contributor

On Mar 20, 2020, at 1:02 PM, Balázs Lengyel <balazs.lengyel=[email-masked] <mailto:balazs.lengyel=[email-masked]> > wrote:

Hello,

Regards Balazs

-- 

Mobile: +36-70-330-7909              email:  <mailto:[email-masked]> [email-masked]

_______________________________________________
netmod mailing list
 <mailto:[email-masked]> [email-masked]
 <https://www.ietf.org/mailman/listinfo/netmod> https://www.ietf.org/mailman/listinfo/netmod

---

From: Ladislav Lhotka <[email-masked]>
Date: Mon, 23 Mar 2020 08:42:26 +0100

On Sat, 2020-03-21 at 14:56 +0000, Balázs Lengyel wrote:
> Also some people (not me) are writing RFCs without XML. SO if it acceptable to
> you, the RFC editor to whoever I will use <CODE...> for the examples. Is that
> acceptable?

Note that according to Legal Provisions Relating to IETF Documents [1], the
<CODE BEGIN> ... <CODE END> tags demarcate "Code Components", so the license
provisions specified in that document apply.

Lada

[1] https://trustee.ietf.org/license-info/IETF-TLP-5.htm

> The manual folding can keep a nice tabulation and fold the line at a word or
> element boundary. I know such editorial niceties are very hard to program in a
> script; but this is one reason to do manual folding.
>  
> Examples are easily extracted from XML via `xmllint` with the “—xpath”
> parameter, after which the `rfcfold` script can be run.  Strongly recommend
> setting the “name” attribute on the <sourcecode> or <artwork> element in the
> XML draft.  It’s good to see that you want to do it this way, as I noticed you
> hand-folded the examples and I’m pretty sure I spotted what looked like might
> result in an undesirable unfolding artifact...
>  
> FWIW, https://pypi.org/project/xiax attempts to do all this, but I suspended
> that effort getting distracted with other things...
>  
> Kent // contributor
>  
>  
> 
> 
> > On Mar 20, 2020, at 1:02 PM, Balázs Lengyel <
> > balazs.lengyel=[email-masked]> wrote:
> >  
> > Hello,
> > [email-masked]
> > https://www.ietf.org/mailman/listinfo/netmod
> 
>  
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod
-- 
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67

---

From: Benoit Claise <[email-masked]>
Date: Mon, 23 Mar 2020 16:54:22 +0100

Hi Balázs,

https://tools.ietf.org/html/rfc8407

        3.2.1 <https://tools.ietf.org/html/rfc8407#section-3.2.1>.
        Example Module

    Example modules are not code components.  The <CODE BEGINS>
    convention MUST NOT be used for example modules.

Regards, Benoit

> Hello,
>
> Is it allowed/recommended to use <CODE BEGINS> <CODE ENDS> around 
> examples. In my case it would be examples of XML and JSON instance 
> data. I would find it rather useful.
>
> As a second step if someone could combine rfcstrip with 
> artwork-unfolding that would be even better.
>
> Regards Balazs
>
> -- 
>
> Balazs Lengyel                    Senior

---

From: Kent Watsen <[email-masked]>
Date: Wed, 25 Mar 2020 17:51:46 +0000

Hi Balazs,

> Also some people (not me) are writing RFCs without XML. SO if it acceptable to you, the RFC editor to whoever I will use <CODE...> for the examples. Is that acceptable?

Rarely do people need to extract examples from drafts.  Those wishing to copy/paste a snippet will likely do so via the HTML version that has its own (and better) way of framing examples.  Those wishing to programmatically process/validate the contents of the drafts (e.g., shepherd, RFC Editor, etc.) prefer working off the source XML.

> The manual folding can keep a nice tabulation and fold the line at a word or element boundary. I know such editorial niceties are very hard to program in a script; but this is one reason to do manu…

Agreed, the artwork-folding draft says this as well.

> I used rfcfold to unfold the acme-router-modules example and I don’t notice anything strange.

I remind my comment. I originally thought a couple space characters were missing (e.g., “foo\” should be “foo \”) but scanning again, I don’t see any issues now.

Thanks,
Kent

> Regards Balazs
>  
> From: Kent Watsen <[email-masked] <mailto:[email-masked]>> 
> To: Balázs Lengyel <[email-masked] <mailto:[email-masked]>>
> Cc: [email-masked] <mailto:[email-masked]>
> FWIW, https://pypi.org/project/xiax <https://pypi.org/project/xiax> attempts to do all this, but I suspended that effort getting distracted with other things...
>  
> Kent // contributor
>  
>  
> 
> 
> On Mar 20, 2020, at 1:02 PM, Balázs Lengyel <balazs.lengyel=[email-masked] <mailto:balazs.lengyel=[email-masked]>> wrote:
>  
> Hello,