diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-31 12:48:40 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-31 12:48:40 +0200 |
commit | 1ab83e42e24dcc8f6e7f0abb6d76bb5c06a8f189 (patch) | |
tree | 31ece483b9241b5b7f3f8e651d0bacd55c1bb753 /doc | |
parent | 68d62d528df5bd17711ed18660fe943cb944e951 (diff) |
Add support for man page generation/install/dist
Diffstat (limited to 'doc')
-rw-r--r-- | doc/.gitignore | 2 | ||||
-rw-r--r-- | doc/buildfile | 19 | ||||
-rwxr-xr-x | doc/cli.sh | 57 | ||||
l--------- | doc/common.css | 1 | ||||
l--------- | doc/man-epilogue.1 | 1 | ||||
l--------- | doc/man-epilogue.xhtml | 1 | ||||
l--------- | doc/man-prologue.1 | 1 | ||||
l--------- | doc/man-prologue.xhtml | 1 | ||||
l--------- | doc/man.css | 1 | ||||
l--------- | doc/pre-box.css | 1 |
10 files changed, 85 insertions, 0 deletions
diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 0000000..c27d2ca --- /dev/null +++ b/doc/.gitignore @@ -0,0 +1,2 @@ +brep*.xhtml +brep*.1 diff --git a/doc/buildfile b/doc/buildfile new file mode 100644 index 0000000..bd3440f --- /dev/null +++ b/doc/buildfile @@ -0,0 +1,19 @@ +# file : doc/buildfile +# copyright : Copyright (c) 2014-2016 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +cmds = \ +brep-load \ +brep-migrate + +define css: file +css{*}: extension = css + +define xhtml: doc +xhtml{*}: extension = xhtml + +./: {man1 xhtml}{$cmds} \ + css{common pre-box man} \ + file{man-prologue.1 man-epilogue.1 \ + man-prologue.xhtml man-epilogue.xhtml \ + cli.sh} diff --git a/doc/cli.sh b/doc/cli.sh new file mode 100755 index 0000000..11aa660 --- /dev/null +++ b/doc/cli.sh @@ -0,0 +1,57 @@ +#! /usr/bin/env bash + +version="0.2.0" +date="January 2016" + +trap 'exit 1' ERR +set -o errtrace # Trap in functions. + +function info () { echo "$*" 1>&2; } +function error () { info "$*"; exit 1; } + +while [ $# -gt 0 ]; do + case $1 in + --clean) + rm -f brep*.xhtml brep*.1 + exit 0 + ;; + *) + error "unexpected $1" + ;; + esac +done + +function compile () +{ + local n=$1; shift + + # Use a bash array to handle empty arguments. + # + local o=() + while [ $# -gt 0 ]; do + o=("${o[@]}" "$1") + shift + done + + cli -I .. -v project="brep" -v version="$version" -v date="$date" \ +--include-base-last "${o[@]}" --generate-html --html-prologue-file \ +man-prologue.xhtml --html-epilogue-file man-epilogue.xhtml --html-suffix \ +.xhtml ../$n.cli + + cli -I .. -v project="brep" -v version="$version" -v date="$date" \ +--include-base-last "${o[@]}" --generate-man --man-prologue-file \ +man-prologue.1 --man-epilogue-file man-epilogue.1 --man-suffix .1 \ +../$n.cli +} + +o="--output-prefix brep-" + +# A few special cases. +# +#compile "brep" $o --output-prefix "" + +pages="load/load migrate/migrate" + +for p in $pages; do + compile $p $o +done diff --git a/doc/common.css b/doc/common.css new file mode 120000 index 0000000..3ddf6fc --- /dev/null +++ b/doc/common.css @@ -0,0 +1 @@ +style/common.css
\ No newline at end of file diff --git a/doc/man-epilogue.1 b/doc/man-epilogue.1 new file mode 120000 index 0000000..878a9ae --- /dev/null +++ b/doc/man-epilogue.1 @@ -0,0 +1 @@ +style/man-epilogue.1
\ No newline at end of file diff --git a/doc/man-epilogue.xhtml b/doc/man-epilogue.xhtml new file mode 120000 index 0000000..6c1722a --- /dev/null +++ b/doc/man-epilogue.xhtml @@ -0,0 +1 @@ +style/man-epilogue.xhtml
\ No newline at end of file diff --git a/doc/man-prologue.1 b/doc/man-prologue.1 new file mode 120000 index 0000000..08b5b4b --- /dev/null +++ b/doc/man-prologue.1 @@ -0,0 +1 @@ +style/man-prologue.1
\ No newline at end of file diff --git a/doc/man-prologue.xhtml b/doc/man-prologue.xhtml new file mode 120000 index 0000000..34997e3 --- /dev/null +++ b/doc/man-prologue.xhtml @@ -0,0 +1 @@ +style/man-prologue.xhtml
\ No newline at end of file diff --git a/doc/man.css b/doc/man.css new file mode 120000 index 0000000..e0c4308 --- /dev/null +++ b/doc/man.css @@ -0,0 +1 @@ +style/man.css
\ No newline at end of file diff --git a/doc/pre-box.css b/doc/pre-box.css new file mode 120000 index 0000000..b9ec76c --- /dev/null +++ b/doc/pre-box.css @@ -0,0 +1 @@ +style/pre-box.css
\ No newline at end of file |