From 0ac9cedb4bd6a1a9bf3cbc04c3529b7881e1fec8 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 21 Sep 2025 16:39:46 +0200 Subject: start book html exporter --- server/tools/src/main.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'server/tools/src/main.rs') diff --git a/server/tools/src/main.rs b/server/tools/src/main.rs index 31da0388..4e5c5787 100644 --- a/server/tools/src/main.rs +++ b/server/tools/src/main.rs @@ -31,6 +31,7 @@ use crate::{ }; use anyhow::Result; use clap::Parser; +use hurrycurry_server::data::DataIndex; #[derive(Parser)] enum Action { @@ -46,8 +47,19 @@ fn main() -> Result<()> { match action { Action::Graph => graph()?, Action::GraphSummary => graph_summary()?, - Action::Book => print_book()?, - Action::BookHtml => render_html_book(book()?)?, + Action::Book => { + let mut index = DataIndex::default(); + index.reload()?; + let (data, serverdata, _) = index.generate("5star")?; + print_book(&data, &serverdata)? + } + Action::BookHtml => { + let mut index = DataIndex::default(); + index.reload()?; + let (data, serverdata, _) = index.generate("5star")?; + let book = book(&data, &serverdata)?; + println!("{}", render_html_book(&data, &book)) + } } Ok(()) -- cgit v1.2.3-70-g09d2