Re: [netmod] reflow of YANG descriptions, and general YANG format annoyances

Ladislav Lhotka <> Mon, 09 November 2020 09:13 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 2915D3A0D6D; Mon, 9 Nov 2020 01:13:41 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Status: No, score=-2.098 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (1024-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id JRXc3pLohdoV; Mon, 9 Nov 2020 01:13:39 -0800 (PST)
Received: from ( [IPv6:2001:1488:800:400::400]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id B08463A0D6B; Mon, 9 Nov 2020 01:13:37 -0800 (PST)
Received: from localhost (unknown [IPv6:2001:1488:fffe:6:a88f:7eff:fed2:45f8]) by (Postfix) with ESMTPSA id 7139D1408CC; Mon, 9 Nov 2020 10:13:35 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;; s=default; t=1604913215; bh=mARSR43SUspbBlkAl7oz3aUe2Q4/lWZEHLDV6yBNyJU=; h=From:To:Date; b=iNgeGES9nUBgMsQw4EB4jDOY4D+pxxAsgRw0aHeJdRuq2j6mXhXilJWlpog95PWLz V7KjWYK4ezWmbmQFiSFTh6Zq9I0gpWn5DcMMT4js3RhtK/4MMkr0aq29cUIso7tsBH JQX2J3Dds+SzrZZ3HHZ99j+cWW/o7T9SG3WBNshE=
From: Ladislav Lhotka <>
To: Michael Richardson <>,,
In-Reply-To: <29950.1604697852@localhost>
References: <29950.1604697852@localhost>
Mail-Followup-To: Michael Richardson <>,,
Date: Mon, 09 Nov 2020 10:13:35 +0100
Message-ID: <>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Virus-Scanned: clamav-milter 0.102.2 at mail
X-Virus-Status: Clean
Archived-At: <>
Subject: Re: [netmod] reflow of YANG descriptions, and general YANG format annoyances
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Mon, 09 Nov 2020 09:13:41 -0000


my solution that I've been using for years is to write YANG modules in the YIN syntax. With the nXML mode of emacs this is actually rather effective (statement completion, on-the-fly validation).

I also extended the YIN syntax with a few XML elements from the XHTML namespace. This helps me to handle paragraphs and lists in a safe way.

Descriptions etc. are then reflowed automatically as a part of XSLT transform to the compact YANG syntax.

Here are the details:

See also


Michael Richardson <> writes:

> As people do more YANG modules, more and more logic and description moves
> from regular text into the YANG module.  Where it is awkward and annoying to
> edit.
> And references from YANG modules don't get counted/resolved/updated, and
> all sorts things that the XML format was designed to solve have basically
> reverted to 1996 era (without even nroff) when it comes text in the YANG module.
> In one of my drafts, I guess some minor wording tweaks in one draft leads to
> some lines exceeding 72 characters (by one). Argh. Change from C-mode to
> text-mode. reflow.
> It seems like we should be thinking about what to do here.
> I was introduced to the SED method of fixing yang YYYYMMDD version
> references.
> While I like YANG as executable "code", it sure feels like it is not smart to
> be authoring in it.
> --
> Michael Richardson <>   . o O ( IPv6 IøT consulting )
>            Sandelman Software Works Inc, Ottawa and Worldwide
> _______________________________________________
> netmod mailing list

Ladislav Lhotka 
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67