use templates

This commit is contained in:
Masataro Asai 2015-12-16 12:13:41 +09:00
parent 3c2431ffee
commit 0a05ade5d4
3 changed files with 40 additions and 2 deletions

View file

@ -3,11 +3,19 @@
# TODO : fetch from https://github.com/snmsts/roswell/wiki and convert all
# wiki pages (mediawiki format or markdown) to html or man
# see also:
# http://pandoc.org/README.html#using-variables-in-templates
# https://github.com/jgm/pandoc-templates/blob/master/default.man
# separated by semicolons
PANDOC_AUTHORS="SANO Masatoshi"
%.1: %.md
pandoc -f markdown_phpextra -t man $< > $@
pandoc -f markdown_phpextra -t man -V title="$*" -V section=$(subst .,,$(suffix $@)) -V author=$(PANDOC_AUTHORS) --template=default.man $< > $@
%.html: %.md
pandoc -f markdown_phpextra -t html5 $< > $@
pandoc -f markdown_phpextra -t html5 -V title="$*" author=$(PANDOC_AUTHORS) $< > $@
if MANUAL_GENERATE
man1_MANS = $(shell ls *.md | sed s/md/1/g) $(shell ls *.md | sed s/md/html/g)

30
documents/default.man Normal file
View file

@ -0,0 +1,30 @@
$if(has-tables)$
.\"t
$endif$
$if(pandoc-version)$
.\" Automatically generated by Pandoc $pandoc-version$
.\"
$endif$
$if(adjusting)$
.ad $adjusting$
$endif$
.TH "$title$" "$section$" "$date$" "$footer$" "$header$"
$if(hyphenate)$
.hy
$else$
.nh \" Turn off hyphenation by default.
$endif$
$for(header-includes)$
$header-includes$
$endfor$
$for(include-before)$
$include-before$
$endfor$
$body$
$for(include-after)$
$include-after$
$endfor$
$if(author)$
.SH AUTHORS
$for(author)$$author$$sep$; $endfor$.
$endif$