Re: [netmod] CODE BEGINS ENDS for examples ?
Kent Watsen <kent@watsen.net> Wed, 25 March 2020 17:51 UTC
Return-Path: <0100017112d2540e-2a4aff46-a141-47a5-b248-5bf22af8ad5e-000000@amazonses.watsen.net>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 592B93A0D89 for <netmod@ietfa.amsl.com>; Wed, 25 Mar 2020 10:51:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Level:
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=amazonses.com
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 jAKnhcHzAHfb for <netmod@ietfa.amsl.com>; Wed, 25 Mar 2020 10:51:47 -0700 (PDT)
Received: from a48-95.smtp-out.amazonses.com (a48-95.smtp-out.amazonses.com [54.240.48.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B3EDB3A0DA7 for <netmod@ietf.org>; Wed, 25 Mar 2020 10:51:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1585158706; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:In-Reply-To:Cc:To:References:Feedback-ID; bh=GphNqly0SdPsXntkIkHTxlHMKm/KxKUAUFjq2Dxwuj4=; b=HHPMns1ncMN85woJEBonNQe4C1rpy/7JuLQ1CXFkdCvzLhBL83YtL7vCAVtz8ZGi hlpSrTXernueIwKbjuXFNPCYMEPmIxTCYAY+4mMdOTrUPRwtr/uDNORdHInk81sc21W bJ0Ptj8r7awt0Bsd4nZp2adEoZVTiKju/ZPuzP/o=
From: Kent Watsen <kent@watsen.net>
Message-ID: <0100017112d2540e-2a4aff46-a141-47a5-b248-5bf22af8ad5e-000000@email.amazonses.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_719A5C52-A06B-45AB-8C42-19F162104EF5"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\))
Date: Wed, 25 Mar 2020 17:51:46 +0000
In-Reply-To: <DB7PR07MB40114D8350A0E22F101A353DF0F20@DB7PR07MB4011.eurprd07.prod.outlook.com>
Cc: "netmod@ietf.org" <netmod@ietf.org>
To: Balázs Lengyel <balazs.lengyel=40ericsson.com@dmarc.ietf.org>
References: <DB7PR07MB401126C42CF7ECA417BC82B5F0F50@DB7PR07MB4011.eurprd07.prod.outlook.com> <01000170fa2db5c9-960b7cf9-6e75-4cb4-a974-93703b852ab7-000000@email.amazonses.com> <DB7PR07MB40114D8350A0E22F101A353DF0F20@DB7PR07MB4011.eurprd07.prod.outlook.com>
X-Mailer: Apple Mail (2.3445.104.11)
X-SES-Outgoing: 2020.03.25-54.240.48.95
Feedback-ID: 1.us-east-1.DKmIRZFhhsBhtmFMNikgwZUWVrODEw9qVcPhqJEI2DA=:AmazonSES
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/KUBtuLDmIfnmP-IMCIf-bezhnok>
Subject: Re: [netmod] CODE BEGINS ENDS for examples ?
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 25 Mar 2020 17:52:00 -0000
Hi Balazs, > 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? 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. > 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. 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 <kent@watsen.net <mailto:kent@watsen.net>> > Sent: 2020. március 21., szombat 0:01 > To: Balázs Lengyel <balazs.lengyel@ericsson.com <mailto:balazs.lengyel@ericsson.com>> > Cc: netmod@ietf.org <mailto:netmod@ietf.org> > Subject: Re: [netmod] CODE BEGINS ENDS for examples ? > > 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 <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=40ericsson.com@dmarc.ietf.org <mailto:balazs.lengyel=40ericsson.com@dmarc.ietf.org>> 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: Balazs.Lengyel@ericsson.com <mailto:Balazs.Lengyel@ericsson.com> > > _______________________________________________ > netmod mailing list > netmod@ietf.org <mailto:netmod@ietf.org> > https://www.ietf.org/mailman/listinfo/netmod <https://www.ietf.org/mailman/listinfo/netmod> > > _______________________________________________ > netmod mailing list > netmod@ietf.org <mailto:netmod@ietf.org> > https://www.ietf.org/mailman/listinfo/netmod <https://www.ietf.org/mailman/listinfo/netmod>
- [netmod] CODE BEGINS ENDS for examples ? Balázs Lengyel
- Re: [netmod] CODE BEGINS ENDS for examples ? Kent Watsen
- Re: [netmod] CODE BEGINS ENDS for examples ? Balázs Lengyel
- Re: [netmod] CODE BEGINS ENDS for examples ? Ladislav Lhotka
- Re: [netmod] CODE BEGINS ENDS for examples ? Benoit Claise
- Re: [netmod] CODE BEGINS ENDS for examples ? Kent Watsen