fn create_handler(previewer: MarkdownPreview) -> Box<Handler> {
    let mut chain = Chain::new(previewer);

    let mut hbse = HandlebarsEngine::new();
    hbse.add(Box::new(DirectorySource::new(
        CRATE_ROOT.join("templates/").to_str().unwrap(),
        ".html",
    )));
    if let Err(r) = hbse.reload() {
        panic!("{}", r);
    }

    chain.link_after(hbse);

    let mut mount = Mount::new();
    mount.mount("/", chain);
    mount.mount("/_static", Static::new(CRATE_ROOT.join("static")));

    Box::new(mount)
}
/// Wraps the markdown handler with other middleware, such as template rendering and static file
/// serving.
Wraps the markdown handler with other middleware, such as template rendering and static file
serving.
Wraps the markdown handler with other middleware such as template rendering and static file serving .
fn create_handler(previewer: MarkdownPreview) -> Box<Handler> {
    let mut chain = Chain::new(previewer);
    let mut hbse = HandlebarsEngine::new();
    hbse.add(Box::new(DirectorySource::new(
        CRATE_ROOT.join("templates/").to_str().unwrap(),
        ".html",
    )));
    if let Err(r) = hbse.reload() {
        panic!("{}", r);
    }
    chain.link_after(hbse);
    let mut mount = Mount::new();
    mount.mount("/", chain);
    mount.mount("/_static", Static::new(CRATE_ROOT.join("static")));
    Box::new(mount)
}
fn create_handler ( previewer : MarkdownPreview ) -> Box < Handler > { let mut chain = Chain :: new ( previewer ) ; let mut hbse = HandlebarsEngine :: new ( ) ; hbse . add ( Box :: new ( DirectorySource :: new ( CRATE_ROOT . join ( " " ) . to_str ( ) . unwrap ( ) , " " , ) ) ) ; if let Err ( r ) = hbse . reload ( ) { panic ! ( " " r ) ; } chain . link_after ( hbse ) ; let mut mount = Mount :: new ( ) ; mount . mount ( " " , chain ) ; mount . mount ( " " , Static :: new ( CRATE_ROOT . join ( " " ) ) ) ; Box :: new ( mount ) }
Wraps the markdown handler with other middleware, such as template rendering and static file
serving.
Wraps the markdown handler with other middleware such as template rendering and static file serving .
previewer
MarkdownPreview
previewer
MarkdownPreview