Skip to content

Commit 9b95833

Browse files
committed
build-sys: Generalize manpage bits to make update-generated
I plan to add more generated-from-source files, so generalize the target which is currently specialized to manpages. Signed-off-by: Colin Walters <[email protected]>
1 parent 298a336 commit 9b95833

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ validate: validate-rust
4545
ruff check
4646
.PHONY: validate
4747

48+
update-generated:
49+
cargo xtask update-generated
50+
.PHONY: update-generated
51+
4852
vendor:
4953
cargo xtask $@
5054
.PHONY: vendor

xtask/src/xtask.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn main() {
1919
#[allow(clippy::type_complexity)]
2020
const TASKS: &[(&str, fn(&Shell) -> Result<()>)] = &[
2121
("manpages", manpages),
22-
("man2markdown", man2markdown),
22+
("update-generated", update_generated),
2323
("package", package),
2424
("package-srpm", package_srpm),
2525
("spec", spec),
@@ -116,12 +116,13 @@ fn manpages(sh: &Shell) -> Result<()> {
116116
Ok(())
117117
}
118118

119-
/// Generate markdown files (converted from the man pages, which are generated
120-
/// from the Rust sources) into docs/src, which ends up in the rendered
121-
/// documentation. This process is currently manual.
122-
#[context("man2markdown")]
123-
fn man2markdown(sh: &Shell) -> Result<()> {
119+
/// Update generated files, such as converting the man pages to markdown.
120+
/// This process is currently manual.
121+
#[context("Updating generated files")]
122+
fn update_generated(sh: &Shell) -> Result<()> {
124123
manpages(sh)?;
124+
// And convert the man pages into markdown, so they can be included
125+
// in the docs.
125126
for ent in std::fs::read_dir("target/man")? {
126127
let ent = ent?;
127128
let path = &ent.path();

0 commit comments

Comments
 (0)