pub fn build_text(con: &AppContext) -> Text<'_> {
    lazy_static! {
        // this doesn't really matter, only half a ms is spared
        static ref TEMPLATE: TextTemplate<'static> = TextTemplate::from(MD);
    }
    let mut expander = TEMPLATE.expander();
    expander
        .set("version", env!("CARGO_PKG_VERSION"))
        .set("config-path", &con.config_path);
    for verb in &con.verb_store.verbs {
        let sub = expander.sub("verb-rows")
            .set("name", &verb.invocation.name)
            .set(
                "shortcut",
                if let Some(sk) = &verb.shortcut { &sk } else { "" }, // TODO use as_deref when it's available
            )
            .set("key", &verb.key_desc);
        if let Some(description) = &verb.description {
            sub.set_md("description", &description);
            sub.set("execution", "");
        } else {
            sub.set("description", "");
            sub.set("execution", &verb.execution);
        }
    }
    expander.expand()
}
/// build the markdown which will be displayed in the help page
build the markdown which will be displayed in the help page
build the markdown which will be displayed in the help page
pub fn build_text(con: &AppContext) -> Text<'_> {
    lazy_static! {
        // this doesn't really matter, only half a ms is spared
        static ref TEMPLATE: TextTemplate<'static> = TextTemplate::from(MD);
    }
    let mut expander = TEMPLATE.expander();
    expander
        .set("version", env!("CARGO_PKG_VERSION"))
        .set("config-path", &con.config_path);
    for verb in &con.verb_store.verbs {
        let sub = expander.sub("verb-rows")
            .set("name", &verb.invocation.name)
            .set(
                "shortcut",
                if let Some(sk) = &verb.shortcut { &sk } else { "" }, // TODO use as_deref when it's available
            )
            .set("key", &verb.key_desc);
        if let Some(description) = &verb.description {
            sub.set_md("description", &description);
            sub.set("execution", "");
        } else {
            sub.set("description", "");
            sub.set("execution", &verb.execution);
        }
    }
    expander.expand()
}
pub fn build_text ( con : & AppContext ) -> Text < ' _ > { lazy_static ! { // this doesn't really matter, only half a ms is spared static ref TEMPLATE TextTemplate ' static TextTemplate from ( MD ) } let mut expander = TEMPLATE . expander ( ) ; expander . set ( " " , env ! ( " " ) ) . set ( " " , & con . config_path ) ; for verb in & con . verb_store . verbs { let sub = expander . sub ( " " ) . set ( " " , & verb . invocation . name ) . set ( " " , if let Some ( sk ) = & verb . shortcut { & sk } else { " " } , // TODO use as_deref when it's available ) . set ( " " , & verb . key_desc ) ; if let Some ( description ) = & verb . description { sub . set_md ( " " , & description ) ; sub . set ( " " , " " ) ; } else { sub . set ( " " , " " ) ; sub . set ( " " , & verb . execution ) ; } } expander . expand ( ) }
build the markdown which will be displayed in the help page
build the markdown which will be displayed in the help page
con
&AppContext
con
&AppContext