Re: [xml2rfc] [xml2rfc-dev] [rfc-i] Script to generate RFC reference including abstract?

"Andrew G. Malis" <agmalis@gmail.com> Mon, 25 January 2021 13:01 UTC

Return-Path: <agmalis@gmail.com>
X-Original-To: xml2rfc@ietfa.amsl.com
Delivered-To: xml2rfc@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6E7BE3A11A5; Mon, 25 Jan 2021 05:01:29 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.198
X-Spam-Level:
X-Spam-Status: No, score=-0.198 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 2jnnxPiHemse; Mon, 25 Jan 2021 05:01:25 -0800 (PST)
Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1834A3A11AC; Mon, 25 Jan 2021 05:01:25 -0800 (PST)
Received: by mail-qt1-x830.google.com with SMTP id r9so9502145qtp.11; Mon, 25 Jan 2021 05:01:25 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NUdFTZdXxADAVpsSvULNPAeWXqAP02UqBNzRsNU8r8c=; b=N4RiX3Ard1QfjE9YzcmZ57FVtN+UgM3iJ7W6N1TILkg1VywnrZKUerOJHG+9dAzm0U tNazeZtb8vjQin1y61uvUFRE83aplaDmfA0P/VpYUpTKM3cxj/b1qKLamFDy6BkYu9Ck stdhiWzyUtrXD/6PxO93X9WlvYp463HAKMgk5mMgk/67G5D/w834R+h4ubHcTTW/Im06 eYrLQ+gH+0GiiQJ9MMWkeu57xwUDfD6DJPUaiVNcFPEg0mVPMMF+gP57JVAyB2Jx1H56 hGLvwWrP1abZS/PyHXC2x0+auieFQ/AiUQDiMVuK6qiVFjUYXl3HENyTGIt1p8fkkvJ/ 33vw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NUdFTZdXxADAVpsSvULNPAeWXqAP02UqBNzRsNU8r8c=; b=k660LGksS22qSxZTLjjE8WYnIw0rHCRfi1yKxVjixO1Fecg9aKehJW4ESknLqKFQ7T F7Y+YeGEqcSbbF0123dbjQk5evqriAwr+AdLaxsT7CPV4tkgakHvpYcXyG4/kobUwixJ MqY3AB21D2GA/Dl+5vk4QDYgHVKjvCVP4U5HZPrdhs/iul1y9GlTBRkMAuXLv5/4HW8S rbIiIe39HyRecgnTBKfB1syeBzELyZgOuGtII2XkMdV9kamZIHgAurUkCjuRszPL59jU J4QhVh422jf5VzSC8tjtBSxICUCuuyj6INkssi+OTzwrxmHif5ER8YrKHNRJ6MRyoW/G PDvw==
X-Gm-Message-State: AOAM530ENu+LPJPJTeBaRGl9xNL4sYGCk51T+sCDRiSX8gNKsim4Bg5n 37+EpBkLXCf5iStwTRPtDujEnLM8F+w5DxqW/Sc=
X-Google-Smtp-Source: ABdhPJzOH9Vp1slcnlWk0WOq73mUvwObOLXfgbNkHrMGVNhg7FyfrQdoRIM89OFrZXnMVHUbst0S3d8sMj9No8UCua4=
X-Received: by 2002:ac8:5985:: with SMTP id e5mr295202qte.160.1611579684037; Mon, 25 Jan 2021 05:01:24 -0800 (PST)
MIME-Version: 1.0
References: <CAA=duU2nj0G2H9v3Fft5iBAA8bxTX0zNgZsevMpojZY3TZQ6dg@mail.gmail.com> <CANeU+ZC7jZmHUTK==WghKb6W-eFZ9eHhH7UNHN9kSxNZR9N7gw@mail.gmail.com> <CAA=duU20AivvTbGQFpAZ09n=wnv-sicJj5Xt0Xamuck_kAJa9A@mail.gmail.com> <F97B1BA2-4E81-4383-83F6-552A2072CF56@ribose.com>
In-Reply-To: <F97B1BA2-4E81-4383-83F6-552A2072CF56@ribose.com>
From: "Andrew G. Malis" <agmalis@gmail.com>
Date: Mon, 25 Jan 2021 08:01:08 -0500
Message-ID: <CAA=duU11c9vhvgf9u_mJDMWPx6LzSuWtHO57p6a=Vq8jDGaSfA@mail.gmail.com>
To: Ronald Tse <tse@ribose.com>
Cc: RFC Interest <rfc-interest@rfc-editor.org>, XML Developer List <xml2rfc-dev@ietf.org>, "xml2rfc@ietf.org" <xml2rfc@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000098297805b9b92252"
Archived-At: <https://mailarchive.ietf.org/arch/msg/xml2rfc/vCESxzOltKnsU9ZlH-LzVE1O-7k>
Subject: Re: [xml2rfc] [xml2rfc-dev] [rfc-i] Script to generate RFC reference including abstract?
X-BeenThere: xml2rfc@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: <xml2rfc.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/xml2rfc>, <mailto:xml2rfc-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/xml2rfc/>
List-Post: <mailto:xml2rfc@ietf.org>
List-Help: <mailto:xml2rfc-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/xml2rfc>, <mailto:xml2rfc-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Jan 2021 13:01:29 -0000

Ron,

Thanks, that helps a lot! Lots of great tools out there.

Cheers,
Andy


On Sun, Jan 24, 2021 at 6:43 PM Ronald Tse <tse@ribose.com> wrote:

> Hi Andy,
>
> Relaton’s CLI (https://github.com/relaton/relaton-cli/) supports
> something like this:
>
> ——
> $ gem install relaton-cli
> $ relaton fetch --type=IETF "RFC 8660"
> ——
>
> STDOUT:
> ——
> <bibitem id="RFC8660" type="standard">
>   <fetched>2021-01-25</fetched>
>   <title format="text/plain" language="en" script="Latn">Segment Routing
> with the MPLS Data Plane</title>
>   <uri type="xml">
> https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8660.xml</uri>
>   <uri type="src">https://www.rfc-editor.org/info/rfc8660</uri>
>   <docidentifier type="IETF">RFC 8660</docidentifier>
>   <docidentifier type="rfc-anchor">RFC8660</docidentifier>
>   <docidentifier type="DOI">10.17487/RFC8660</docidentifier>
> …
>   <contributor>
>     <role type="editor"/>
>     <person>
>       <name>
>         <completename language="en">A. Bashandy</completename>
>       </name>
>       <affiliation>
>         <organization>
>           <name>Internet Engineering Task Force</name>
>           <abbreviation>IETF</abbreviation>
>         </organization>
>       </affiliation>
>     </person>
>   </contributor>
> ...
>   <language>en</language>
>   <script>Latn</script>
>   <abstract format="text/plain" language="en" script="Latn">Segment
> Routing (SR) leverages the source-routing paradigm.  A node steers a packet
> through a controlled set of instructions, called segments, by prepending
> the packet with an SR header.  In the MPLS data plane, the SR header is
> instantiated through a label stack. This document specifies the forwarding
> behavior to allow instantiating SR over the MPLS data plane
> (SR-MPLS).</abstract>
>   <series type="main">
>     <title format="text/plain" language="en" script="Latn">RFC</title>
>     <number>8660</number>
>   </series>
>   <place>Fremont, CA</place>
> </bibitem>
> ——
>
> The output is Relaton XML, which you could re-format into the format
> desired using XPath utilities like xmllint or xmlstarlet.
>
> e.g.
> ——
> $ relaton fetch --type=IETF "RFC 8660"> foo.xml 2>/dev/null
> $ xmllint --xpath '/bibitem/abstract/text()' foo.xml
> Segment Routing (SR) leverages the source-routing paradigm.  …
> ——
>
> You could also output the bibtex format:
> ——
> $ relaton fetch --type=IETF --format=bibtex "RFC 8660"> foo.bib 2>/dev/null
> $ cat foo.bib
> @misc{RFC8660,
>   author = {Previdi, S. and Decraene, B. and Litkowski, S. and Shakir, R.},
>   publisher = {Internet Engineering Task Force},
>   address = {Fremont, CA},
>   year = {2019},
>   month = dec,
>   timestamp = {2021-01-25},
>   url = {https://www.rfc-editor.org/info/rfc8660},
>   month_numeric = {12}
> }
> ——
>
> Hope this helps!
>
> Ron
>
> P.S. Relaton CLI supports references to most SDOs including ISO, IEC, etc
> using a unified bibliographic metadata model.
>
> _____________________________________
>
> Ronald Tse
> Ribose Inc.
>
> On Jan 25, 2021, at 5:39 AM, Andrew G. Malis <agmalis@gmail.com> wrote:
>
> Mike,
>
> Thanks, not quite what I was looking for, but it might be useful as a
> basis for scripting.
>
> Cheers,
> Andy
>
>
> On Sun, Jan 24, 2021 at 2:21 PM StJohns, Michael <msj@nthpermutation.com>
> wrote:
>
>> Maybe try this?
>> http://web-harvest.sourceforge.net/manual.php
>>
>>
>>
>> On Sun, Jan 24, 2021 at 12:04 Andrew G. Malis <agmalis@gmail.com> wrote:
>>
>>> Just to save myself a bit of work if this already exists ....
>>>
>>> Have any of you written a script when, given a list of RFC numbers, will
>>> generate an xml2rfc-ish reference and pull out the abstract for each RFC?
>>> Something like, when given "8660", will produce:
>>>
>>>    [RFC8660]  Bashandy, A., Ed., Filsfils, C., Ed., Previdi, S.,
>>>               Decraene, B., Litkowski, S., and R. Shakir, "Segment
>>>               Routing with the MPLS Data Plane", RFC 8660,
>>>               DOI 10.17487/RFC8660, December 2019,
>>>               <https://www.rfc-editor.org/info/rfc8660>.
>>>
>>>    Segment Routing (SR) leverages the source-routing paradigm.  A node
>>>    steers a packet through a controlled set of instructions, called
>>>    segments, by prepending the packet with an SR header.  In the MPLS
>>>    data plane, the SR header is instantiated through a label stack.
>>>    This document specifies the forwarding behavior to allow
>>>    instantiating SR over the MPLS data plane (SR-MPLS).
>>>
>>> Thanks,
>>> Andy
>>>
>>> _______________________________________________
>>> rfc-interest mailing list
>>> rfc-interest@rfc-editor.org
>>> https://www.rfc-editor.org/mailman/listinfo/rfc-interest
>>>
>> _______________________________________________
> xml2rfc-dev mailing list
> xml2rfc-dev@ietf.org
> https://www.ietf.org/mailman/listinfo/xml2rfc-dev
>
>
>