x

Programs, configuration and documentation that don't fit anywhere else
Log | Files | Refs | README | LICENSE

commit 0952bc0ae884782cff9729f9cc72b01610708e97
parent 15cd19198260b38236da4164929010671f02e626
Author: Oliver Lowe <o@olowe.co>
Date:   Fri, 15 Nov 2024 18:49:36 +1100

import rfc document fetcher

Diffstat:
MREADME | 1+
Abin/rfc | 11+++++++++++
Aman/rfc.1 | 18++++++++++++++++++
3 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/README b/README @@ -11,6 +11,7 @@ The following commands are provided: - lemmyverse - find lemmy communities - llama - prompt a large language model - precis - summarise text +- rfc - read IETF RFC documents - webpaste - create a web paste on webpaste.olowe.co - ws - web search - xstream - stream X display over the network diff --git a/bin/rfc b/bin/rfc @@ -0,0 +1,11 @@ +#!/bin/sh + +name=rfc$1.txt +url=https://www.rfc-editor.org/rfc/$name +mkdir -p $HOME/.cache/rfc +cache=$HOME/.cache/rfc/$name +if ! test -f $cache +then + curl -s $url > $cache +fi +/usr/local/plan9/bin/9 B $cache diff --git a/man/rfc.1 b/man/rfc.1 @@ -0,0 +1,18 @@ +.Dd +.Dt RFC 1 +.Sh NAME +.Nm rfc +.Nd read IETF RFC documents +.Sh SYNOPSIS +.Nm +.Ar number +.Sh DESCRIPTION +.Nm +opens the given numbered RFC in the editor +via a +.Xr plumb 7 +message. +The plain text version from rfc-editor.org is downloaded +and stored in the user cache directory +.Pa $HOME/.cache/rfc +for faster subsequent reads.