From ad257079568746d71d913c6fca96852da6fe3bd6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 11 Jan 2016 10:04:02 +0200 Subject: Reorganize .cli files, add man/xhtml page generation (via script for now) --- doc/.gitignore | 2 ++ doc/cli.sh | 58 ++++++++++++++++++++++++++++++++++++++++++++ doc/epilogue.1 | 7 ++++++ doc/epilogue.xhtml | 11 +++++++++ doc/prologue.1 | 6 +++++ doc/prologue.xhtml | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 154 insertions(+) create mode 100644 doc/.gitignore create mode 100755 doc/cli.sh create mode 100644 doc/epilogue.1 create mode 100644 doc/epilogue.xhtml create mode 100644 doc/prologue.1 create mode 100644 doc/prologue.xhtml (limited to 'doc') 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 @@ +

BUGS

+ +

Send bug reports to the @@ mailing list.

+ + + + + + + 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 @@ + + + + + $name$($section$) bpkg $version$ + + + +
+ +

NAME

+ +

$name$ – $summary$

-- cgit v1.1