Fix render command.

This commit is contained in:
2025-07-05 13:59:31 -05:00
parent 4de2b399f5
commit deee0e8d29
2 changed files with 22 additions and 5 deletions

View File

@@ -190,12 +190,22 @@ struct Args {
template_path: Option<String>
}
fn print_tree(historian: &Historian, page: &Page, prefix: &str) {
for child in &page.children {
if let Some(child_page) = historian.resolve_to_page(&child.full_name) {
println!("{}{}", prefix, child_page.full_name);
print_tree(historian, &child_page, &format!("{}{}", prefix, prefix));
}
}
}
#[rocket::main]
async fn main() {
let args = Args::parse();
if let Some(wiki_path) = args.wiki_path {
let historian = Historian::new(wiki_path);
print_tree(&historian, &historian.resolve_to_page("").unwrap(), "*");
let renderer = if let Some(template_path) = args.template_path {
PageRenderer::with_template_path(&template_path)