Re: [netmod] CODE BEGINS ENDS for examples ?

Balázs Lengyel <balazs.lengyel@ericsson.com> Sat, 21 March 2020 14:56 UTC

Return-Path: <balazs.lengyel@ericsson.com>
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 775543A09A1 for <netmod@ietfa.amsl.com>; Sat, 21 Mar 2020 07:56:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.09
X-Spam-Level:
X-Spam-Status: No, score=-2.09 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=ericsson.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 FeXy1YbrVJ-Z for <netmod@ietfa.amsl.com>; Sat, 21 Mar 2020 07:56:48 -0700 (PDT)
Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150059.outbound.protection.outlook.com [40.107.15.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1C2303A141C for <netmod@ietf.org>; Sat, 21 Mar 2020 07:56:47 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dain57Ku0b98ijvvvgJ2k4k33V9l3k4m7wIHXVxDwObimC5E+ROAOajmPnJHlSyHvLvQe7g89BmpzxjuRti9S4kaBvfcqtRa4IxWPuqDdS/p6YPaqxz8pM1scksnUf7fhuHzfddqAWIkbj1Sb9651Urr9AVWmgzAD3BqyIO5Hzhkj/+x+is2v+iFmWvWYSBvv4VJhY+vHeNvztj6N3Tnw2OGEFR9dvu0hY4hDiiY/hYNYqdzpC+Zw/vwy3W/4GiHAtjBnDqFAICm2qgXJjTx94S8WzvpNFCIZvJAd9Fmpqiq6hqymcL1dQJ1O/qdGjn/voX/q06YNVunnra70VH2mg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;bh=Zaouxd5+wlhkhGxbeYwrER1sWRyKWARHzldPZo+Uwvk=; b=W8XRdQ/krhac532CHtXXKonxEMUJKr9gTYXW11kvT34rH1nZbQg7dP7/f7fp9X4Y40vZp0p+5OVJJfYQy9rWsaZffsXR9pFcVNM1jDBxd25F7bEhghzyuNnx5EPVsCip50RG/jsweXyvlYmRcQuPEMqFp5X8Lz4fVqsF+7iKsnonFRS5ej8ZzZEr83Wtz7FljGhWGN+bPFS+YmgX9e9TJbu5GnupKVzRBn2TK0FU4Ftfw/hlSMDy68GColkS54QrUtjnYJEYB7I1TRDxgnRqlWy0cVnZ/UY6p9W8fPaxQZaj63ke19QRdqztf9hQT95y6VRytvBXIhMxRK9oyiNzGg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ericsson.com; dmarc=pass action=none header.from=ericsson.com; dkim=pass header.d=ericsson.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;bh=Zaouxd5+wlhkhGxbeYwrER1sWRyKWARHzldPZo+Uwvk=; b=fS5p8hFCeck8wQEEHWGUJzzqb7cePbSldZioi/kDYrpmgw3U4933Ian09Mk7uHDVzkDxMFf2AkjiiJiQue9lI6jpEs8cgZ3gzAd3oj6LYSX9qVrCNGQAxnRBq0VgQuV+66YpBnlFlgN5KRxwEqWr1cwu/i0iuKCZDgxux+K/zvQ=
Received: from DB7PR07MB4011.eurprd07.prod.outlook.com (52.134.97.155) by DB7PR07MB6012.eurprd07.prod.outlook.com (20.178.85.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.12; Sat, 21 Mar 2020 14:56:45 +0000
Received: from DB7PR07MB4011.eurprd07.prod.outlook.com ([fe80::15cf:dc81:c6f4:aa0c]) by DB7PR07MB4011.eurprd07.prod.outlook.com ([fe80::15cf:dc81:c6f4:aa0c%7]) with mapi id 15.20.2835.013; Sat, 21 Mar 2020 14:56:45 +0000
From: Balázs Lengyel <balazs.lengyel@ericsson.com>
To: Kent Watsen <kent@watsen.net>
CC: "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: [netmod] CODE BEGINS ENDS for examples ?
Thread-Index: AdX+14XchWpTwSP9TECumgI75/RSewAM+iUAACDzvqA=
Date: Sat, 21 Mar 2020 14:56:45 +0000
Message-ID: <DB7PR07MB40114D8350A0E22F101A353DF0F20@DB7PR07MB4011.eurprd07.prod.outlook.com>
References: <DB7PR07MB401126C42CF7ECA417BC82B5F0F50@DB7PR07MB4011.eurprd07.prod.outlook.com> <01000170fa2db5c9-960b7cf9-6e75-4cb4-a974-93703b852ab7-000000@email.amazonses.com>
In-Reply-To: <01000170fa2db5c9-960b7cf9-6e75-4cb4-a974-93703b852ab7-000000@email.amazonses.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=balazs.lengyel@ericsson.com;
x-originating-ip: [80.98.254.17]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 45470bc4-240c-4b5c-117e-08d7cda812ea
x-ms-traffictypediagnostic: DB7PR07MB6012:
x-microsoft-antispam-prvs: <DB7PR07MB60122FFC6DA055525E78BE0BF0F20@DB7PR07MB6012.eurprd07.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:9508;
x-forefront-prvs: 034902F5BC
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(39860400002)(376002)(396003)(366004)(136003)(199004)(26005)(86362001)(186003)(4326008)(66574012)(85182001)(71200400001)(966005)(81156014)(9686003)(6506007)(8936002)(7696005)(85202003)(316002)(478600001)(2906002)(53546011)(52536014)(6916009)(8676002)(76116006)(33656002)(66556008)(9326002)(66946007)(66476007)(64756008)(81166006)(66446008)(66616009)(55016002)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR07MB6012; H:DB7PR07MB4011.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1;
received-spf: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: IKmYJD/khUgf+iBQEnv+llMlrtvwozhzRgNR7ISr9KZBOSHW5tatmiNzpTy07PskCO9bzzpagRh0Bk4wwpC7m6afDSSHer4Y0O2lw/d8SO04W4EWy07pxqlvjXzkF+3u3ulS5m8N7A34fymLLBHEy9IWx0NicjZ+lvySqs8rxtyTrWDmDWxoR3VjmRpdRtVlMSK+j2tfpvR7i4iOiHkhmauVZtqgloJa5m3S3/n5IuAUENZsKTo9NwArK4pqTu1avJnacPbTGxhbbeKx0cQEkUN1HNmVDp47rXwN7EI9wgrlec3xFqDm9ceXlps/ZqmM8hsdPUo74H/tJfLy4/olf5qukSTgEAXc/xV/EeSHkygryxYw/BgMCgz69vdqh4Nh5LEhh5hYoNEtj2E3qkJ0hEm7tfE8WwaouwmBBCeArV4Svg0AGgCdboBiWXiUsXQupnEOqsz6At9ZENR47a5zOKxuu8KNiVu+wHR6SB2dV8qzlkuzi7wV74UW0WkySMbATz3WVqOo28kiUc/MY7divg==
x-ms-exchange-antispam-messagedata: Je34e8UJO796pRw7H3UzhvxSD0C96gbJxFL5ETiTkXhMPlpwYQJu6iaq4P/kYAPoD/Yj6RIQiQiAFQEIGFX3fQHE1GyFYoCtVckginUwQBn5+hmBnM45VvkGdz0vUhCHOYfuhFWt+mzxvxPzFUcUZQ==
x-ms-exchange-transport-forked: True
Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="SHA1"; boundary="----=_NextPart_000_00CF_01D5FF99.513BF260"
MIME-Version: 1.0
X-OriginatorOrg: ericsson.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 45470bc4-240c-4b5c-117e-08d7cda812ea
X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Mar 2020 14:56:45.0534 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: fBoExoFvzJT68Tw5tC16CSE4xjukPAPs+PeAGUZxZtMZhHHiMMywENSol172T60L1SSqwwvLbfH2zl0k65fpF2FUkwRAwmydXjJWzVcKK+s=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR07MB6012
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/ur1nip7pTW7vGZa9ATQ9V94A0vI>
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: Sat, 21 Mar 2020 14:56:54 -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 <kent@watsen.net> 
Sent: 2020. március 21., szombat 0:01
To: Balázs Lengyel <balazs.lengyel@ericsson.com>
Cc: 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 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:  <mailto:Balazs.Lengyel@ericsson.com> Balazs.Lengyel@ericsson.com

 

_______________________________________________
netmod mailing list
 <mailto:netmod@ietf.org> netmod@ietf.org
 <https://www.ietf.org/mailman/listinfo/netmod> https://www.ietf.org/mailman/listinfo/netmod