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