Fix render command.
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user