summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2010-01-15 21:23:52 -0800
committerKaz Kylheku <kaz@kylheku.com>2010-01-15 21:23:52 -0800
commit7c119e002015dffd2d625c2ebb694cea41c97901 (patch)
treef5f18c9ca714ddb2ec50b2ba30c12185083af65d
parentb067244c5c421192213af424a5d645f2bad7ee62 (diff)
downloadtxr-7c119e002015dffd2d625c2ebb694cea41c97901.tar.gz
txr-7c119e002015dffd2d625c2ebb694cea41c97901.tar.bz2
txr-7c119e002015dffd2d625c2ebb694cea41c97901.zip
Automate the maintenance of the HTML-ized man page.
-rw-r--r--ChangeLog9
-rw-r--r--Makefile6
-rw-r--r--genman.txr79
3 files changed, 94 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 74305de8..5cbe11e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2010-01-15 Kaz Kylheku <kkylheku@gmail.com>
+ Automate the maintenance of the HTML-ized man page.
+
+ * Makefile (txr-manpage.html): New target, generated from txr.1
+ man page.
+
+ * genman.txr: New txr query to transform the output of man2html.
+
+2010-01-15 Kaz Kylheku <kkylheku@gmail.com>
+
Implemented non-greedy operator.
* lib.c (nongreedy_s): New symbol globals.
diff --git a/Makefile b/Makefile
index 5713e0c1..1aabe1a2 100644
--- a/Makefile
+++ b/Makefile
@@ -133,6 +133,12 @@ install-tests:
> run.sh
$(call INSTALL,0755,run.sh,$(DESTDIR)$(datadir)/tests)
+#
+# Generate web page from man page
+#
+txr-manpage.html: txr.1 genman.txr
+ man2html $< | $(PROG) genman.txr - > $@
+
config.make config.h:
@echo "$@ missing: you didn't run ./configure"
@exit 1
diff --git a/genman.txr b/genman.txr
new file mode 100644
index 00000000..ece2734f
--- /dev/null
+++ b/genman.txr
@@ -0,0 +1,79 @@
+@(bind VERSION "023")
+Content-type: text/html
+@(skip 15)
+<H1>txr</H1>
+@/.*Updated:/ @YEAR-@MONTH-@DAY<BR><A HREF="#index">Index</A>
+@(collect)
+@PREAMBLE
+@(until)
+txr - text extractor
+@(end)
+@(collect)
+@BODY
+@(until)
+<HR>
+<A NAME="index">&nbsp;</A><H2>Index</H2>
+@(end)
+<HR>
+@(collect)
+@TOC
+@(until)
+This document was created by
+@(end)
+@(maybe)
+@ (bind MONTH "1")
+@ (bind MNAME "Jan")
+@(or)
+@ (bind MONTH "2")
+@ (bind MNAME "Feb")
+@(or)
+@ (bind MONTH "3")
+@ (bind MNAME "Mar")
+@(or)
+@ (bind MONTH "4")
+@ (bind MNAME "Apr")
+@(or)
+@ (bind MONTH "5")
+@ (bind MNAME "May")
+@(or)
+@ (bind MONTH "6")
+@ (bind MNAME "Jun")
+@(or)
+@ (bind MONTH "7")
+@ (bind MNAME "Jul")
+@(or)
+@ (bind MONTH "8")
+@ (bind MNAME "Aug")
+@(or)
+@ (bind MONTH "9")
+@ (bind MNAME "Sep")
+@(or)
+@ (bind MONTH "10")
+@ (bind MNAME "Octn")
+@(or)
+@ (bind MONTH "11")
+@ (bind MNAME "Nov")
+@(or)
+@ (bind MONTH "12")
+@ (bind MNAME "Dec")
+@(end)
+@(output)
+<HTML>
+<FONT FACE="courier">
+<HEAD><TITLE>Manpage for txr @VERSION</TITLE>
+</HEAD><BODY>
+<H2>Manpage for <A HREF="#lbAB">Txr</a> version @VERSION</H2>
+<H2>@MNAME @DAY, @YEAR</H2>
+@(repeat)
+@TOC
+@(end)
+@(repeat)
+@PREAMBLE
+@(first)
+@(end)
+@(repeat)
+@BODY
+@(end)
+</BODY>
+</HTML>
+@(end)