Add support for custom template path.
This commit is contained in:
14
src/main.rs
14
src/main.rs
@@ -181,14 +181,24 @@ struct Args {
|
||||
|
||||
/// Resolve all wiki links in the given page, output the modified text
|
||||
#[arg(long)]
|
||||
resolve_links: Option<String>
|
||||
resolve_links: Option<String>,
|
||||
|
||||
/// Path to templates
|
||||
#[arg(long)]
|
||||
template_path: Option<String>
|
||||
}
|
||||
|
||||
#[rocket::main]
|
||||
async fn main() {
|
||||
let args = Args::parse();
|
||||
let historian = Historian::new(args.wiki_path);
|
||||
let renderer = PageRenderer::new();
|
||||
|
||||
let renderer = if let Some(template_path) = args.template_path {
|
||||
PageRenderer::with_template_path(&template_path)
|
||||
} else {
|
||||
PageRenderer::new()
|
||||
};
|
||||
|
||||
let linker = Linker::new(&historian);
|
||||
|
||||
if let Some(resolve_link) = args.resolve_link {
|
||||
|
||||
Reference in New Issue
Block a user