From 840a2c3a1c10e55804ad21db4c1dd26796f1f3c6 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Fri, 22 Feb 2013 01:10:25 +0000 Subject: [PATCH] etc/mirrors.d/50-rfc: Build bibliographic database from the RFC index. --- etc/mirrors.d/50-rfc | 12 +++ lib/rfcxmlindex2bibtex.xslt | 233 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 245 insertions(+) create mode 100644 lib/rfcxmlindex2bibtex.xslt diff --git a/etc/mirrors.d/50-rfc b/etc/mirrors.d/50-rfc index e44e1d4..d7b4388 100755 --- a/etc/mirrors.d/50-rfc +++ b/etc/mirrors.d/50-rfc @@ -17,3 +17,15 @@ standard_rsync "$@" \ standard_rsync "$@" \ rsync.mirrorservice.org::ftp.isi.edu/internet-drafts/ \ internet-drafts/ + +## Build a usable BibTeX database of RFCs. XSLT runes are by Roland +## Bless, taken from http://www.tm.uka.de/~bless/bibrfcindex.html +mkdir -p rfc-bib +if [ rfc/rfc-index.xml -nt rfc-bib/rfc.bib ]; then + xsltproc $HOME/lib/rfcxmlindex2bibtex.xslt rfc/rfc-index.xml | + sed ' + s/\([_&%#$]\)/\\\1/g + /author=/s/\([^ ]*\) \(3rd\|Jr\.\)/\{\1 \2\}/g + ' >rfc-bib/rfc-bib.new + mv rfc-bib/rfc-bib.new rfc-bib/rfc.bib +fi diff --git a/lib/rfcxmlindex2bibtex.xslt b/lib/rfcxmlindex2bibtex.xslt new file mode 100644 index 0000000..3006969 --- /dev/null +++ b/lib/rfcxmlindex2bibtex.xslt @@ -0,0 +1,233 @@ + + + + + + + + + + + + + @misc + + + +RFC + + + +http://www.ietf.org/rfc/ + + + +Obsoleted by + + + +Updated by + + +STANDARD +DRAFT STANDARD +PROPOSED STANDARD +UNKNOWN +BEST CURRENT PRACTICE +FOR YOUR INFORMATION +EXPERIMENTAL +HISTORIC +INFORMATIONAL + +Standard +Draft Standard +Proposed Standard +Unknown +Best Current Practice +For Your Information +Experimental +Historic +Informational + + + + + + + + + + _ + + + + + + + + + + + + + + {rfc + + , + author=" + + + + + and + + ", + , + series="Request for Comments", + number="", + howpublished="RFC + + + + + + + + + + + + + + + + + + ()", + publisher="IETF", + organisation="Internet Engineering Task Force", + year=, + month=, + + + note=" + + + + + + , + + + + + + ", + url="rfc.txt", +} + + + + + + title="{}" + + + + + title="{ + + + + + + + + + + + + + + + }" + + + + + + + + + + + + + + + + + + + + \ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +day="", + + + + + RFCs + + + + , + + + + + + RFCs + + + + , + + + + + -- 2.11.0