Add support for custom template path.

This commit is contained in:
2024-09-27 05:03:02 -05:00
parent 9ae1022a21
commit 2198201713
2 changed files with 19 additions and 5 deletions

View File

@@ -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 {