newtypedecl 0.0.1

declarative newtype macro
Documentation
//! The purpose of this build script is only to extract documentation from the
//! macro sources. rustdoc can not do this.

use std::env;
use std::path::PathBuf;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let out_dir = PathBuf::from(env::var("OUT_DIR")?);

    docextract::Docextract::new(&out_dir.join("newtype_macro_syntax.md"))?
        .input_filtered("src/lib.rs", "^syntax_struct")?
        .input_filtered("src/lib.rs", "^syntax_assocfn")?
        .input_filtered("src/lib.rs", "^syntax_impltrait")?
        .input_filtered("src/lib.rs", "^syntax_fn")?
        .done()?;

    docextract::Docextract::new(&out_dir.join("newtype_macro_traits.md"))?
        .input_filtered("src/lib.rs", "^trait")?
        .done()?;

    docextract::Docextract::new(&out_dir.join("newtype_macro_fns.md"))?
        .input_filtered("src/lib.rs", "^fn")?
        .done()?;

    docextract::Docextract::new(&out_dir.join("newtype_predef.md"))?
        .input_filtered("src/lib.rs", "^predef")?
        .done()?;

    Ok(())
}