From 383457db62afab702a392ea20349546fcb601407 Mon Sep 17 00:00:00 2001 From: Daniel Jones <104509116+DanielReddJones@users.noreply.github.com> Date: Mon, 1 May 2023 15:31:08 -0500 Subject: [PATCH] Added epub functions Still not properly grabbing the text, but must leave it for now. Uploading to Github for later access. --- src/main.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index f526f0a..02e9028 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,10 +1,10 @@ /* Program: Bibliofile -Language: Rustc 1.68.0 +Language: Rustc 1.69.0 ide: Visual Studio Code -Operating system: +Operating system: Fedora 38/WSL Purpose: ncurses based ereader and library manager for Linux terminal environments. -Last edited: 9:55 PM 5/1/23 +Last edited: 5/1/23 */ use epub::doc::EpubDoc; @@ -27,11 +27,15 @@ fn main() { //parses epub files fn epub(epub_file: &str){ - + let item_count = 0; println!("{}", epub_file); let doc = EpubDoc::new(&epub_file); assert!(doc.is_ok()); let doc = doc.unwrap(); + assert_eq!(105, doc.spine.len()); + let page = &doc.spine[item_count]; + let text = doc.resources.get(page); + println!("{:?}", text); }