Skip to content

Commit e928120

Browse files
committed
Auto merge of #8577 - ehuss:mdman, r=alexcrichton
Add mdman for generating man pages. This introduces a new utility called `mdman` that converts a markdown-formatted document to a man page. This replaces asciidoctor, with the intent to make it easier to contribute, easier to have consistent formatting across platforms, and easier to generate plain-text documents for use on Windows (for #8456). This also includes a number of formatting fixes. There is some documentation in the `mdman/doc` directory explaining how to use it, and the docs in `src/doc/README.md` have been updated (this explains the structure of the files). The Makefile has been replaced with a simple shell script. CI has been updated to verify the checked-in docs are up-to-date. Perhaps in the future, these can be generated automatically (perhaps by `build.rs`?), but since that requires a bit of build system work (like upstream rust), this is deferred till later.
2 parents af539d2 + 566706e commit e928120

File tree

282 files changed

+23865
-19914
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

282 files changed

+23865
-19914
lines changed

.github/workflows/main.yml

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
- run: cd crates/crates-io && cargo fmt --all -- --check
2424
- run: cd crates/resolver-tests && cargo fmt --all -- --check
2525
- run: cd crates/cargo-platform && cargo fmt --all -- --check
26+
- run: cd crates/mdman && cargo fmt --all -- --check
2627

2728
test:
2829
runs-on: ${{ matrix.os }}
@@ -65,6 +66,7 @@ jobs:
6566
- run: cargo test --features 'deny-warnings'
6667
- run: cargo test --features 'deny-warnings' -p cargo-test-support
6768
- run: cargo test -p cargo-platform
69+
- run: cargo test --manifest-path crates/mdman/Cargo.toml
6870

6971
resolver:
7072
runs-on: ubuntu-latest
@@ -89,6 +91,7 @@ jobs:
8991
- uses: actions/checkout@v2
9092
- run: rustup update nightly && rustup default nightly
9193
- run: rustup component add rust-docs
94+
- run: ci/validate-man.sh
9295
- run: |
9396
mkdir mdbook
9497
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.3.7/mdbook-v0.3.7-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook

ci/validate-man.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
# This script validates that there aren't any changes to the man pages.
3+
4+
set -e
5+
6+
cd src/doc
7+
8+
changes=$(git status --porcelain .)
9+
if [ -n "$changes" ]
10+
then
11+
echo "git directory must be clean before running this script."
12+
exit 1
13+
fi
14+
15+
./build-man.sh
16+
17+
changes=$(git status --porcelain .)
18+
if [ -n "$changes" ]
19+
then
20+
echo "Detected changes in man pages:"
21+
echo "$changes"
22+
echo
23+
echo "Please run './build-man.sh' in the src/doc directory to rebuild the"
24+
echo "man pages, and commit the changes."
25+
exit 1
26+
fi

0 commit comments

Comments
 (0)