diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-11 10:04:02 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-11 10:04:02 +0200 |
commit | ad257079568746d71d913c6fca96852da6fe3bd6 (patch) | |
tree | d7a59392a1159c630c4fd0ccad816e9fd3acadf3 /doc | |
parent | 302834a875804ff943dfb005682949fd3d404d01 (diff) |
Reorganize .cli files, add man/xhtml page generation (via script for now)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/.gitignore | 2 | ||||
-rwxr-xr-x | doc/cli.sh | 58 | ||||
-rw-r--r-- | doc/epilogue.1 | 7 | ||||
-rw-r--r-- | doc/epilogue.xhtml | 11 | ||||
-rw-r--r-- | doc/prologue.1 | 6 | ||||
-rw-r--r-- | doc/prologue.xhtml | 70 |
6 files changed, 154 insertions, 0 deletions
diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 0000000..ada8beb --- /dev/null +++ b/doc/.gitignore @@ -0,0 +1,2 @@ +bpkg*.xhtml +bpkg*.1 diff --git a/doc/cli.sh b/doc/cli.sh new file mode 100755 index 0000000..d022a47 --- /dev/null +++ b/doc/cli.sh @@ -0,0 +1,58 @@ +#! /usr/bin/env bash + +version="0.2.0" +date="XX 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 bpkg*.xhtml bpkg*.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 version="$version" -v date="$date" --include-base-last "${o[@]}" \ +--generate-html --html-prologue-file prologue.xhtml --html-epilogue-file \ +epilogue.xhtml --html-suffix .xhtml ../bpkg/$n.cli + + cli -I .. -v version="$version" -v date="$date" --include-base-last "${o[@]}" \ +--generate-man --man-prologue-file prologue.1 --man-epilogue-file epilogue.1 \ +--man-suffix .1 ../bpkg/$n.cli +} + +o="--output-prefix bpkg- --class-doc bpkg::common_options=short" + +# A few special cases. +# +compile "common" $o --output-suffix "-options" --class-doc bpkg::common_options=long +compile "bpkg" $o --output-prefix "" --suppress-undocumented --class-doc bpkg::commands=short --class-doc bpkg::topics=short + +pages="cfg-add cfg-create cfg-fetch help pkg-build pkg-clean pkg-configure \ +pkg-disfigure pkg-drop pkg-fetch pkg-install pkg-purge pkg-status \ +pkg-uninstall pkg-unpack pkg-update pkg-verify rep-create rep-info" + +for p in $pages; do + compile $p $o +done diff --git a/doc/epilogue.1 b/doc/epilogue.1 new file mode 100644 index 0000000..584f1c0 --- /dev/null +++ b/doc/epilogue.1 @@ -0,0 +1,7 @@ +.SH BUGS +Send bug reports to the @@ mailing list. +.SH COPYRIGHT +Copyright (c) 2014-2016 Code Synthesis Ltd + +Permission is granted to copy, distribute and/or modify this document under +the terms of the MIT License. diff --git a/doc/epilogue.xhtml b/doc/epilogue.xhtml new file mode 100644 index 0000000..a835371 --- /dev/null +++ b/doc/epilogue.xhtml @@ -0,0 +1,11 @@ + <h1>BUGS</h1> + + <p>Send bug reports to the <a href="mailto:@@">@@</a> mailing list.</p> + +</div> + +<div id="footer">© 2014-2016 Code Synthesis Ltd<br/> + Distributed under the terms of the MIT License</div> + +</body> +</html> diff --git a/doc/prologue.1 b/doc/prologue.1 new file mode 100644 index 0000000..9a71279 --- /dev/null +++ b/doc/prologue.1 @@ -0,0 +1,6 @@ +.\" Process this file with +.\" groff -man -Tascii $name$.$section$ +.\" +.TH $name$ $section$ "$date$" "bpkg $version$" +.SH NAME +\fB$name$\fR \- $summary$ diff --git a/doc/prologue.xhtml b/doc/prologue.xhtml new file mode 100644 index 0000000..a307d1f --- /dev/null +++ b/doc/prologue.xhtml @@ -0,0 +1,70 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="UTF-8"/> + <title>$name$($section$) bpkg $version$</title> + <style type="text/css"> + html + { + font-family: sans-serif; + font-weight: normal; + font-size: 18px; + line-height: 1.4em; + + text-align: justify; + } + + body {margin: 0;} + body {min-width: 17em;} + @media only screen and (min-width: 360px) + { + body {min-width: 19em;} + } + + #content + { + max-width: 40em; + margin: 0 auto 0 auto; + padding: 0 .4em 0 1.5em; + } + + #footer + { + color: #666; + font-size: 0.833em; + line-height: 1.3em; + text-align: center; + margin: 2.2em 0 1em 0; + } + + h1 + { + color: #333; + font-weight: normal; + font-size: 1.58em; + line-height: 1.4em; + + margin: 1.6em 0 .6em -.92em; + } + + code, pre {font-size: 0.94em;} + + .options { + margin: 1em 0 1em 0; + } + + .options dt { + margin: 1em 0 0 0; + } + + .options dd { + margin: .1em 0 0 4.5em; + } + </style> +</head> +<body> +<div id="content"> + + <h1>NAME</h1> + + <p><b><code>$name$</code></b> – $summary$</p> |