diff options
| author | metamuffin <metamuffin@disroot.org> | 2025-09-21 16:39:46 +0200 | 
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2025-09-21 16:39:49 +0200 | 
| commit | 0ac9cedb4bd6a1a9bf3cbc04c3529b7881e1fec8 (patch) | |
| tree | 5bec367345163776b2e526f41a5d5aab91107e6d /server/tools/src/main.rs | |
| parent | 829a20227e23ed45ae4949d19160bc412916b2ad (diff) | |
| download | hurrycurry-0ac9cedb4bd6a1a9bf3cbc04c3529b7881e1fec8.tar hurrycurry-0ac9cedb4bd6a1a9bf3cbc04c3529b7881e1fec8.tar.bz2 hurrycurry-0ac9cedb4bd6a1a9bf3cbc04c3529b7881e1fec8.tar.zst  | |
start book html exporter
Diffstat (limited to 'server/tools/src/main.rs')
| -rw-r--r-- | server/tools/src/main.rs | 16 | 
1 files changed, 14 insertions, 2 deletions
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(())  |