aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-03-01 16:37:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-03-01 16:37:07 +0200
commit100150a3598d931fbbee361c33374cd5b95a8d86 (patch)
treedafe8fdd5acd73c3832756faccad0a34c8f807ee /doc
parentdeb9b06626141481681cd82e08eddb6627a9a81c (diff)
Setup documentation infrastructure
Diffstat (limited to 'doc')
-rw-r--r--doc/.gitignore5
l---------doc/a4.html2ps1
-rwxr-xr-xdoc/cli.sh83
l---------doc/code-box.css1
l---------doc/common.css1
l---------doc/doc-epilogue.xhtml1
l---------doc/doc-prologue.xhtml1
l---------doc/doc.css1
l---------doc/doc.html2ps1
l---------doc/letter.html2ps1
l---------doc/man-epilogue.11
l---------doc/man-epilogue.xhtml1
l---------doc/man-prologue.11
l---------doc/man-prologue.xhtml1
l---------doc/man.css1
l---------doc/pre-box.css1
l---------doc/toc.css1
17 files changed, 103 insertions, 0 deletions
diff --git a/doc/.gitignore b/doc/.gitignore
new file mode 100644
index 0000000..66632ae
--- /dev/null
+++ b/doc/.gitignore
@@ -0,0 +1,5 @@
+bdep*.xhtml
+bdep*.1
+build2-project-manager-manual*.ps
+build2-project-manager-manual*.pdf
+build2-project-manager-manual.xhtml
diff --git a/doc/a4.html2ps b/doc/a4.html2ps
new file mode 120000
index 0000000..4b31c06
--- /dev/null
+++ b/doc/a4.html2ps
@@ -0,0 +1 @@
+style/a4.html2ps \ No newline at end of file
diff --git a/doc/cli.sh b/doc/cli.sh
new file mode 100755
index 0000000..d06c181
--- /dev/null
+++ b/doc/cli.sh
@@ -0,0 +1,83 @@
+#! /usr/bin/env bash
+
+version=0.7.0-a.0.z
+date="$(date +"%B %Y")"
+
+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 bdep*.xhtml bdep*.1
+ rm -f build2-project-manager-manual*.ps \
+ build2-project-manager-manual*.pdf \
+ build2-project-manager-manual.xhtml
+ 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="bdep" -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 \
+--link-regex '%bdep(#.+)?%build2-project-manager-manual.xhtml$1%' \
+../bdep/$n.cli
+
+ cli -I .. -v project="bdep" -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 \
+--link-regex '%bdep(#.+)?%$1%' \
+../bdep/$n.cli
+}
+
+o="--output-prefix bdep- --class-doc bdep::common_options=short"
+
+# A few special cases.
+#
+compile "common" $o --output-suffix "-options" --class-doc bdep::common_options=long
+compile "bdep" $o --output-prefix "" --suppress-undocumented --class-doc bdep::commands=short --class-doc bdep::topics=short
+
+pages="bdep common help init"
+
+for p in $pages; do
+ compile $p $o
+done
+
+# Manual.
+#
+exit 0
+
+cli -I .. \
+-v version="$(echo "$version" | sed -e 's/^\([^.]*\.[^.]*\).*/\1/')" \
+-v date="$date" \
+--generate-html --html-suffix .xhtml \
+--html-prologue-file doc-prologue.xhtml \
+--html-epilogue-file doc-epilogue.xhtml \
+--link-regex '%b([-.].+)%../../build2/doc/b$1%' \
+--link-regex '%build2(#.+)?%../../build2/doc/build2-build-system-manual.xhtml$1%' \
+--output-prefix build2-project-manager- manual.cli
+
+html2ps -f doc.html2ps:a4.html2ps -o build2-project-manager-manual-a4.ps build2-project-manager-manual.xhtml
+ps2pdf14 -sPAPERSIZE=a4 -dOptimize=true -dEmbedAllFonts=true build2-project-manager-manual-a4.ps build2-project-manager-manual-a4.pdf
+
+html2ps -f doc.html2ps:letter.html2ps -o build2-project-manager-manual-letter.ps build2-project-manager-manual.xhtml
+ps2pdf14 -sPAPERSIZE=letter -dOptimize=true -dEmbedAllFonts=true build2-project-manager-manual-letter.ps build2-project-manager-manual-letter.pdf
diff --git a/doc/code-box.css b/doc/code-box.css
new file mode 120000
index 0000000..e442993
--- /dev/null
+++ b/doc/code-box.css
@@ -0,0 +1 @@
+style/code-box.css \ No newline at end of file
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/doc-epilogue.xhtml b/doc/doc-epilogue.xhtml
new file mode 120000
index 0000000..5111ca2
--- /dev/null
+++ b/doc/doc-epilogue.xhtml
@@ -0,0 +1 @@
+style/doc-epilogue.xhtml \ No newline at end of file
diff --git a/doc/doc-prologue.xhtml b/doc/doc-prologue.xhtml
new file mode 120000
index 0000000..e1fd108
--- /dev/null
+++ b/doc/doc-prologue.xhtml
@@ -0,0 +1 @@
+style/doc-prologue.xhtml \ No newline at end of file
diff --git a/doc/doc.css b/doc/doc.css
new file mode 120000
index 0000000..6cb3fd5
--- /dev/null
+++ b/doc/doc.css
@@ -0,0 +1 @@
+style/doc.css \ No newline at end of file
diff --git a/doc/doc.html2ps b/doc/doc.html2ps
new file mode 120000
index 0000000..dc19855
--- /dev/null
+++ b/doc/doc.html2ps
@@ -0,0 +1 @@
+style/doc.html2ps \ No newline at end of file
diff --git a/doc/letter.html2ps b/doc/letter.html2ps
new file mode 120000
index 0000000..607ca58
--- /dev/null
+++ b/doc/letter.html2ps
@@ -0,0 +1 @@
+style/letter.html2ps \ 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
diff --git a/doc/toc.css b/doc/toc.css
new file mode 120000
index 0000000..477b331
--- /dev/null
+++ b/doc/toc.css
@@ -0,0 +1 @@
+style/toc.css \ No newline at end of file