[Rfc-markdown] kdwatch (Re: [Tools-discuss] Let's have better tools)

Carsten Bormann <cabo@tzi.org> Sat, 03 July 2021 18:50 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: rfc-markdown@ietfa.amsl.com
Delivered-To: rfc-markdown@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3611E3A203C for <rfc-markdown@ietfa.amsl.com>; Sat, 3 Jul 2021 11:50:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.656
X-Spam-Level:
X-Spam-Status: No, score=-0.656 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, NUMERIC_HTTP_ADDR=1.242, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, WEIRD_PORT=0.001] autolearn=ham autolearn_force=no
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 SLPZdYQW9DjZ for <rfc-markdown@ietfa.amsl.com>; Sat, 3 Jul 2021 11:50:19 -0700 (PDT)
Received: from gabriel-2.zfn.uni-bremen.de (gabriel-2.zfn.uni-bremen.de [134.102.50.19]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3E9B23A203B for <rfc-markdown@ietf.org>; Sat, 3 Jul 2021 11:50:18 -0700 (PDT)
Received: from smtpclient.apple (p548dcc89.dip0.t-ipconnect.de [84.141.204.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-2.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4GHLc80NKJz2xG9; Sat, 3 Jul 2021 20:50:16 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <AADC35DD-F2F7-410D-9FDC-57A6DC367E72@tzi.org>
Date: Sat, 03 Jul 2021 20:50:15 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <4A05BDE4-A813-43D8-A992-FA5737C48279@tzi.org>
References: <20210627013258.1D30F188447C@ary.qy> <691b91b6-86d7-2a3d-b9dc-8c19cc507db4@gmail.com> <584d34d6-5630-bbb7-35cc-9459dabc80f0@taugh.com> <82887902-90d0-3616-656b-fc39e4febd47@gmail.com> <70fee53d-28b9-874a-6988-6c1234ca149@taugh.com> <55B80E3D-E22B-439F-9D5B-96185A1CE65B@tzi.org> <CAA=duU17ZAbi-yD7xsaKewgn4dxiS-jYmZuZhEQet2UhfrfpSw@mail.gmail.com> <fc52d7a2-bdc-b799-2278-77096f32e2f@taugh.com> <98f8f742-e395-6c86-44ca-1a862b268390@gmx.de> <AADC35DD-F2F7-410D-9FDC-57A6DC367E72@tzi.org>
To: rfc-markdown@ietf.org
X-Mailer: Apple Mail (2.3654.100.0.2.22)
Archived-At: <https://mailarchive.ietf.org/arch/msg/rfc-markdown/RcsJ7LjnwEQF0wInOYwrV4ik1rY>
Subject: [Rfc-markdown] kdwatch (Re: [Tools-discuss] Let's have better tools)
X-BeenThere: rfc-markdown@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "rfc-markdown is a discussion list for people writing I-Ds and RFCs in Markdown and the authors of the tools used for that." <rfc-markdown.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/rfc-markdown>, <mailto:rfc-markdown-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/rfc-markdown/>
List-Post: <mailto:rfc-markdown@ietf.org>
List-Help: <mailto:rfc-markdown-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rfc-markdown>, <mailto:rfc-markdown-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 03 Jul 2021 18:50:24 -0000

On 27. Jun 2021, at 22:15, Carsten Bormann <cabo@tzi.org> wrote:
> 
>> Or you could run a text-editor and web browser side-by-side and use
>> rfc2629.xslt's "live HTML refresh" feature (see
>> <https://greenbytes.de/tech/webdav/rfc2629xslt/rfc2629xslt.html#html.live.refresh>).
> 
> Doing something like this server-based (server runs on your laptop) is a SMOP (small matter of programming), and I’m already using that for other kinds of markdown.
> Coming to an I-D/RFC markdown processor of your choice […]

It is that time in the year again, so we need all the help we can get.

For the pioneers among us:

Do once:
$ pip3 install --upgrade xml2rfc   [in a pinch, kdrfc will use the IETF web service]
$ gem update
$ gem install kdwatch
(For some reason, this takes a couple minutes, during the first few of which it may seem nothing happens.)

Do for each use:
Open a separate terminal window/screen.
In a directory that has a single draft-*.md (or select one by specifying the markdown file name on the command line):

$ kdwatch

(There can only be one kdwatch active on each host at the moment; the port numbers aren’t actively managed yet.)

After about 10 seconds, a browser will open (or an error message will pop up with the URL to use, which currently always is http://127.0.0.1:7991/).

Now, whenever you do an editor save, after a couple seconds (1.6 s for my Intel Mac, 0.8 s for my M1 Mac) you see an updated HTML in the browser.

You need to keep the kdwatch terminal/screen open to see potential error messages.


This has only been tested on macOS, but *should* work on Linux.  No idea about WSL.
There is very little error handling yet, so restarts of the tool may be required, or sometimes reloading in the browser (CMD-R/F5) is all that is needed.

The fun thing is that you can fill in the hostname of the laptop and use the URL on a different browser (e.g., http://mymac.local:7991 on your iPad or another laptop), and save some screen real-estate.
(I’m assuming you are not “on the Internet” here… But maybe this even can be used for joint viewing :-)

If you try it, please send feedback (and, in case of an error, *all* output on the kdwatch terminal window, please).

Grüße, Carsten