diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-09-15 22:43:03 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-09-15 23:19:28 -0700 |
commit | bd075c8f746dfa97e3e2fe74a262e747806cf772 (patch) | |
tree | 8699b9cb783589ce020668028389713743e1baf2 /Documentation/GNUmakefile | |
parent | 8f0f376e49b1b3f924ac4856ccff201b975f5f79 (diff) | |
download | unicorn-bd075c8f746dfa97e3e2fe74a262e747806cf772.tar.gz |
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.
Diffstat (limited to 'Documentation/GNUmakefile')
-rw-r--r-- | Documentation/GNUmakefile | 33 |
1 files changed, 33 insertions, 0 deletions
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)) |