mirror of https://github.com/rust-lang/cargo
mdman: use `cargo build-man` everywhere
This commit is contained in:
parent
c01bad9b20
commit
e3dec38f4b
|
@ -3,24 +3,25 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
cd src/doc
|
cargo_man="src/doc"
|
||||||
|
mdman_man="crates/mdman/doc"
|
||||||
|
|
||||||
changes=$(git status --porcelain -- .)
|
changes=$(git status --porcelain -- $cargo_man $mdman_man)
|
||||||
if [ -n "$changes" ]
|
if [ -n "$changes" ]
|
||||||
then
|
then
|
||||||
echo "git directory must be clean before running this script."
|
echo "git directory must be clean before running this script."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./build-man.sh
|
cargo build-man
|
||||||
|
|
||||||
changes=$(git status --porcelain -- .)
|
changes=$(git status --porcelain -- $cargo_man $mdman_man)
|
||||||
if [ -n "$changes" ]
|
if [ -n "$changes" ]
|
||||||
then
|
then
|
||||||
echo "Detected changes of man pages in src/doc:"
|
echo "Detected changes of man pages:"
|
||||||
echo "$changes"
|
echo "$changes"
|
||||||
echo
|
echo
|
||||||
echo "Please run './build-man.sh' in the src/doc directory to rebuild the"
|
echo 'Please run `cargo build-man` to rebuild the man pages'
|
||||||
echo "man pages, and commit the changes."
|
echo "and commit the changes."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
cargo run -- -t md -o doc/out doc/*.md
|
|
||||||
cargo run -- -t txt -o doc/out doc/*.md
|
|
||||||
cargo run -- -t man -o doc/out doc/*.md
|
|
|
@ -50,11 +50,7 @@ directory) to three different formats:
|
||||||
3. Plain text (needed for embedded man pages on platforms without man such as
|
3. Plain text (needed for embedded man pages on platforms without man such as
|
||||||
Windows), saved in [`src/doc/man/generated_txt/`](man/generated_txt).
|
Windows), saved in [`src/doc/man/generated_txt/`](man/generated_txt).
|
||||||
|
|
||||||
To rebuild the man pages, run the script `build-man.sh` in the `src/doc` directory.
|
To rebuild the man pages, run `cargo build-man` inside the workspace.
|
||||||
|
|
||||||
```console
|
|
||||||
$ ./build-man.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
### SemVer chapter tests
|
### SemVer chapter tests
|
||||||
|
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
#!/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 -p mdman -- \
|
|
||||||
-t md -o src/commands man/cargo*.md \
|
|
||||||
$OPTIONS
|
|
||||||
|
|
||||||
cargo run -p mdman -- \
|
|
||||||
-t txt -o man/generated_txt man/cargo*.md \
|
|
||||||
$OPTIONS
|
|
||||||
|
|
||||||
cargo run -p mdman -- \
|
|
||||||
-t man -o ../etc/man man/cargo*.md \
|
|
||||||
$OPTIONS
|
|
Loading…
Reference in New Issue