Implement man page generation
This commit is contained in:
parent
b7c8dc3fba
commit
2bb2c69269
1 changed files with 15 additions and 17 deletions
32
build.rs
32
build.rs
|
@ -1,4 +1,6 @@
|
||||||
|
#![allow(unused_imports)]
|
||||||
use roff::{Roff, bold, italic, roman};
|
use roff::{Roff, bold, italic, roman};
|
||||||
|
use std::{env, path::PathBuf};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let page = Roff::new()
|
let page = Roff::new()
|
||||||
|
@ -6,27 +8,23 @@ fn main() {
|
||||||
.control("SH", ["NAME"])
|
.control("SH", ["NAME"])
|
||||||
.text([roman("sesh - Semantic Shell")])
|
.text([roman("sesh - Semantic Shell")])
|
||||||
.control("SH", ["SYNOPSIS"])
|
.control("SH", ["SYNOPSIS"])
|
||||||
.text([
|
.text([bold("sesh"), roman(" [options]")])
|
||||||
bold("sesh"),
|
|
||||||
roman(" [options]"),
|
|
||||||
])
|
|
||||||
.control("SH", ["DESCRIPTION"])
|
.control("SH", ["DESCRIPTION"])
|
||||||
.text([
|
.text([
|
||||||
bold("sesh"),
|
bold("sesh"),
|
||||||
roman("is a shell designed to be as semantic to use as possible"),
|
roman("is a shell designed to be as semantic to use as possible"),
|
||||||
])
|
])
|
||||||
.control("SH", ["OPTIONS"])
|
|
||||||
.control("TP", [])
|
|
||||||
.text([
|
|
||||||
bold("-n"),
|
|
||||||
roman(", "),
|
|
||||||
bold("--bits"),
|
|
||||||
roman("="),
|
|
||||||
italic("BITS"),
|
|
||||||
])
|
|
||||||
.text([roman(
|
|
||||||
"Set the number of bits to modify. Default is one bit.",
|
|
||||||
)])
|
|
||||||
.render();
|
.render();
|
||||||
print!("{}", page);
|
std::fs::write(
|
||||||
|
PathBuf::from(env::var_os("OUT_DIR").unwrap())
|
||||||
|
.parent()
|
||||||
|
.unwrap()
|
||||||
|
.parent()
|
||||||
|
.unwrap()
|
||||||
|
.parent()
|
||||||
|
.unwrap()
|
||||||
|
.join("sesh.1"),
|
||||||
|
page,
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue