Add print-tree command.

This commit is contained in:
2025-07-05 14:21:15 -05:00
parent deee0e8d29
commit dbc1d91521

View File

@@ -173,6 +173,10 @@ struct Args {
/// Path to wiki repository
wiki_path: Option<String>,
/// Print a tree of the wiki contents.
#[arg(long)]
print_tree: bool,
/// Render the wiki to a static website
#[arg(long)]
render_to: Option<String>,
@@ -205,7 +209,11 @@ async fn main() {
if let Some(wiki_path) = args.wiki_path {
let historian = Historian::new(wiki_path);
if args.print_tree {
print_tree(&historian, &historian.resolve_to_page("").unwrap(), "*");
return;
}
let renderer = if let Some(template_path) = args.template_path {
PageRenderer::with_template_path(&template_path)