diff --git a/ci/validate-man.sh b/ci/validate-man.sh index f636b4605..a3f114214 100755 --- a/ci/validate-man.sh +++ b/ci/validate-man.sh @@ -3,24 +3,25 @@ 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" ] then echo "git directory must be clean before running this script." exit 1 fi -./build-man.sh +cargo build-man -changes=$(git status --porcelain -- .) +changes=$(git status --porcelain -- $cargo_man $mdman_man) if [ -n "$changes" ] then - echo "Detected changes of man pages in src/doc:" + echo "Detected changes of man pages:" echo "$changes" echo - echo "Please run './build-man.sh' in the src/doc directory to rebuild the" - echo "man pages, and commit the changes." + echo 'Please run `cargo build-man` to rebuild the man pages' + echo "and commit the changes." exit 1 fi diff --git a/crates/mdman/build-man.sh b/crates/mdman/build-man.sh deleted file mode 100755 index 9286b17c2..000000000 --- a/crates/mdman/build-man.sh +++ /dev/null @@ -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 diff --git a/src/doc/README.md b/src/doc/README.md index 79181b7f6..88c330287 100644 --- a/src/doc/README.md +++ b/src/doc/README.md @@ -50,11 +50,7 @@ directory) to three different formats: 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). -To rebuild the man pages, run the script `build-man.sh` in the `src/doc` directory. - -```console -$ ./build-man.sh -``` +To rebuild the man pages, run `cargo build-man` inside the workspace. ### SemVer chapter tests diff --git a/src/doc/build-man.sh b/src/doc/build-man.sh deleted file mode 100755 index 77af5b510..000000000 --- a/src/doc/build-man.sh +++ /dev/null @@ -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