forked from rust-lang-cn/cargo-cn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-man.sh
26 lines (21 loc) · 913 Bytes
/
build-man.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/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
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=./mdman/Cargo.toml -- \
-t md -o src/commands man/cargo*.md \
$OPTIONS
cargo run --manifest-path=./mdman/Cargo.toml -- \
-t txt -o man/generated_txt man/cargo*.md \
$OPTIONS