From bd075c8f746dfa97e3e2fe74a262e747806cf772 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 15 Sep 2009 22:43:03 -0700 Subject: Add new Documentation section for manpages Only "unicorn(1)" is documented right now, but more will be added. Manpages are written Markdown since it's easy to write, easy to read (in source form) and a widely-implemented format. As of September 2009, pandoc is the only Markdown processor I know of capable of turning Markdown into manpages. So despite adding a dependency on Haskell (not yet very common these days) for documentation, the features and performance of pandoc+Markdown outweigh the drawbacks compared to other lightweight markup systems. --- Documentation/GNUmakefile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Documentation/GNUmakefile (limited to 'Documentation/GNUmakefile') diff --git a/Documentation/GNUmakefile b/Documentation/GNUmakefile new file mode 100644 index 0000000..bd64133 --- /dev/null +++ b/Documentation/GNUmakefile @@ -0,0 +1,33 @@ +all:: + +PANDOC = pandoc +PANDOC_OPTS = -s -f markdown --email-obfuscation=none --sanitize-html +pandoc = $(PANDOC) $(PANDOC_OPTS) +pandoc_html = $(pandoc) --toc -t html --no-wrap + +man1 := unicorn + +all:: html man +doc-gz: man-gz html-gz + +html: $(addsuffix .1.html,$(man1)) +man: $(addsuffix .1,$(man1)) +html-gz: $(addsuffix .1.html.gz,$(man1)) +man-gz: $(addsuffix .1.gz,$(man1)) + +%.1: %.1.txt + $(pandoc) -t man < $< > $@+ && mv $@+ $@ +%.1.html: %.1.txt + $(pandoc_html) -T $(basename $@) < $< > $@+ && mv $@+ $@ + +%.1.gz: %.1 + gzip --rsyncable < $< > $@+ && mv $@+ $@ + +%.1.html.gz: %.1.html + gzip --rsyncable < $< > $@+ && mv $@+ $@ + +clean:: + $(RM) $(addsuffix .1.html,$(man1)) + $(RM) $(addsuffix .1,$(man1)) + $(RM) $(addsuffix .1.html.gz,$(man1)) + $(RM) $(addsuffix .1.gz,$(man1)) -- cgit v1.2.3-24-ge0c7