Function generate_man_pages

Source
pub fn generate_man_pages(
    asset_dir: &Path,
    builder: &Builder,
) -> Result<(), Error>
Expand description

Generates man pages.

asset_dir is the directory where the man pages will be written.

version is the bare version string, which is usually obtained from env!("CARGO_PKG_VERSION").

If extra_version is Some, then the version is created version (extra_version).

The helper files man-pandoc.lua, man-pandoc.inc.html and man2html.sh, will also be written to the directory.

If you define a data type Cli, then you would do:

use clap::CommandFactory;
use clap::Parser;

#[derive(Parser, Debug)]
#[clap(
   name = "sq",
   about = "A command-line frontend for Sequoia, an implementation of OpenPGP")]
struct Cli {
    // ...
}

let dir = sequoia_man::asset_out_dir("man-pages")?;
let mut cli = Cli::command();
let mut builder = sequoia_man::man::Builder::new(&mut cli, env!("CARGO_PKG_VERSION"), None);
builder.see_also(&[ "For the full documentation see <https://...>." ]);
sequoia_man::generate_man_pages(&dir, &builder)?;

To convert the man pages to HTML, run the man2html.sh script.

bash .../man-pages/man2html.sh