crabmail

Static HTML email archive viewer in Rust
git clone git://git.alexwennerberg.com/crabmail
Log | Files | Refs | README | LICENSE

commit bb02f1103cf193bcb8558f1b28569b935787cbca
parent 2be8214335b333a944f23be43162fad7e08d8ab7
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sat, 12 Mar 2022 08:11:49 -0800

notes

Diffstat:
Msrc/main.rs | 7++++---
Msrc/models.rs | 2+-
2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/main.rs b/src/main.rs @@ -81,13 +81,13 @@ impl List<'_> { // where to live // List { threads: vec![] } fn write_all_files(&self) { - let index = self.out_dir.join("index.html"); + let index = self.out_dir.join("index"); let thread_dir = self.out_dir.join("threads"); - println!("asdf"); std::fs::create_dir_all(&thread_dir).unwrap(); + write_if_unchanged(&self.out_dir.join("atom.xml"), self.to_html().as_bytes()); + // TODO write index (paginated) gmi // write index (paginated) html - // write xml feed // Delete threads that aren't in my list (xml, gmi, html) for thread in &self.threads { let basepath = thread_dir.join(&pathescape_msg_id(&thread.messages[0].id)); @@ -138,6 +138,7 @@ fn main() -> Result<()> { let msg = mail_parser::Message::parse(&data).context("Missing mail bytes")?; list.add_email(&msg, f.path().to_path_buf()); } + // id list into thread list.finalize(); lists.add(list, &dir_name); } diff --git a/src/models.rs b/src/models.rs @@ -61,7 +61,7 @@ pub struct StrMessage<'a> { } impl StrMessage<'_> { - // Raw file path + pub fn from_file() {} } // i suck at Cow and strings