From 592efa05e747359be717705d82ec25acca0f16b2 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Fri, 18 Dec 2020 22:59:41 -0500 Subject: Add scripts to download, compress and tag IETF RFCs --- rfc/.gitignore | 3 +++ rfc/Makefile | 11 +++++++++++ rfc/rfctags.pl | 26 ++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 rfc/.gitignore create mode 100644 rfc/Makefile create mode 100644 rfc/rfctags.pl (limited to 'rfc') diff --git a/rfc/.gitignore b/rfc/.gitignore new file mode 100644 index 00000000..808cd63e --- /dev/null +++ b/rfc/.gitignore @@ -0,0 +1,3 @@ +*.txt +*.txt.gz +tags diff --git a/rfc/Makefile b/rfc/Makefile new file mode 100644 index 00000000..ed89a4e4 --- /dev/null +++ b/rfc/Makefile @@ -0,0 +1,11 @@ +tags: rfctags.pl + perl rfctags.pl > $@ + +sync: + rsync -z ftp.rfc-editor.org::rfcs-text-only/'rfc[0-9]*.txt' . + +compress: + gzip -9f *.txt + +clean: + rm -f *.txt *.txt.gz tags diff --git a/rfc/rfctags.pl b/rfc/rfctags.pl new file mode 100644 index 00000000..cd3ba288 --- /dev/null +++ b/rfc/rfctags.pl @@ -0,0 +1,26 @@ +use strict; +use warnings; +use open ':encoding(ISO-8859-1)'; + +use IO::Uncompress::Gunzip qw($GunzipError); + +($,, $\) = ("\t", "\n"); +for my $rfc (<*.txt.gz>) { + my $handle = new IO::Uncompress::Gunzip $rfc + or die "${rfc}: ${GunzipError}"; + while (<$handle>) { + chomp; + # Section headings + if (/^([\d.]+|[A-Z][.])\s+([^\t]+)/) { + print $1, $rfc, $.; + print $2, $rfc, $.; + } + # References + if (/^\s*(\[[\w-]+\])\s{2,}/) { + print $1, $rfc, $.; + print "\\$1", $rfc, $.; # vim ^] prepends \ to [ + } + } + die "${rfc}: $!" if $!; + close $handle; +} -- cgit 1.4.1 n value='grep'>log msg
path: root/doc/zlib/deflatePending.3 (unfollow)
Commit message (Expand)Author
2021-01-28Move gpl.c and agpl.c templates out of etcJune McEnroe
2021-01-27Set para and sect for mdocJune McEnroe
2021-01-26Use First state to match keyword at beginning of lineJune McEnroe
2021-01-25Install vi on Linux and nvi on macOSJune McEnroe
2021-01-25Use vi and lessJune McEnroe
2021-01-20Use mtags for sh in source-filterJune McEnroe
2021-01-20Generate tags for sh files in mtagsJune McEnroe
2021-01-20Add messy sh lexerJune McEnroe
2021-01-20Add all target to git.causal.agency MakefileJune McEnroe
2021-01-20Remove Lua supportJune McEnroe
2021-01-20Fix tests for diff spansJune McEnroe
2021-01-20Avoid matching ':' in make tagsJune McEnroe
2021-01-19Prefer tag matches not preceded by [[:alnum:]]June McEnroe
2021-01-19Escape \ and / in mtags search patternsJune McEnroe
2021-01-20Use mtags in source-filterJune McEnroe
2021-01-19Add mtags to generate tags for make and mdocJune McEnroe
2021-01-19Map tags to IDs using only [[:alnum:]-._]June McEnroe
2021-01-19Don't use a pager if reading standard inputJune McEnroe
2021-01-19Support BSD make syntax and match *.amJune McEnroe
2021-01-19Match tab following escaped newline in make assignmentsJune McEnroe
2021-01-18Allow matching lexers using first input lineJune McEnroe