mdzk 0.3.4

Plain text Zettelkasten based on mdBook
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::{load_zk, renderer::HtmlMdzk};
use mdbook::{errors::*, renderer::{HtmlHandlebars, MarkdownRenderer}};
use std::path::PathBuf;

pub fn build(dir: Option<PathBuf>, renderer: String) -> Result<()> {
    let zk = load_zk(dir)?;

    match renderer.as_str() {
        "markdown" => zk.execute_build_process(&MarkdownRenderer)?,
        "mdzk" => zk.execute_build_process(&HtmlMdzk)?,
        _ => zk.execute_build_process(&HtmlHandlebars)?,
    }

    Ok(())
}