summaryrefslogtreecommitdiffstats
path: root/src/doc/build-man.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xsrc/doc/build-man.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/doc/build-man.sh b/src/doc/build-man.sh
new file mode 100755
index 0000000..7b1330b
--- /dev/null
+++ b/src/doc/build-man.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+#
+# This script builds the Cargo man pages.
+#
+# The source for the man pages are located in src/doc/man/ in markdown format.
+# These also are handlebars templates, see crates/mdman/README.md for details.
+#
+# The generated man pages are placed in the src/etc/man/ directory. The pages
+# are also expanded into markdown (after being expanded by handlebars) and
+# saved in the src/doc/src/commands/ directory. These are included in the
+# Cargo book, which is converted to HTML by mdbook.
+
+set -e
+
+cd "$(dirname "${BASH_SOURCE[0]}")"
+
+OPTIONS="--url https://doc.rust-lang.org/cargo/commands/ \
+ --man rustc:1=https://doc.rust-lang.org/rustc/index.html \
+ --man rustdoc:1=https://doc.rust-lang.org/rustdoc/index.html"
+
+cargo run --manifest-path=../../crates/mdman/Cargo.toml -- \
+ -t md -o src/commands man/cargo*.md \
+ $OPTIONS
+
+cargo run --manifest-path=../../crates/mdman/Cargo.toml -- \
+ -t txt -o man/generated_txt man/cargo*.md \
+ $OPTIONS
+
+cargo run --manifest-path=../../crates/mdman/Cargo.toml -- \
+ -t man -o ../etc/man man/cargo*.md \
+ $OPTIONS