2023-03-17 03:22:09 +00:00
|
|
|
/*
|
|
|
|
Program: Bibliofile
|
2023-05-01 20:31:08 +00:00
|
|
|
Language: Rustc 1.69.0
|
2023-03-17 03:22:09 +00:00
|
|
|
ide: Visual Studio Code
|
2023-05-01 20:31:08 +00:00
|
|
|
Operating system: Fedora 38/WSL
|
2023-03-17 03:22:09 +00:00
|
|
|
Purpose: ncurses based ereader and library manager for Linux terminal environments.
|
2023-05-01 20:31:08 +00:00
|
|
|
Last edited: 5/1/23
|
2023-03-17 03:22:09 +00:00
|
|
|
*/
|
|
|
|
|
2023-05-01 16:24:26 +00:00
|
|
|
use epub::doc::EpubDoc;
|
2023-03-17 02:10:15 +00:00
|
|
|
use std::env;
|
|
|
|
|
2023-03-17 03:22:09 +00:00
|
|
|
|
|
|
|
//initial function. Reads the ebook passed by argument.
|
|
|
|
//TODO: add visual library to pull up ebooks.
|
2023-03-18 01:05:02 +00:00
|
|
|
fn main() {
|
2023-05-01 16:24:26 +00:00
|
|
|
let args: Vec<String> = env::args().collect();
|
|
|
|
let filename = &args[1];
|
|
|
|
epub(filename);
|
2023-03-18 01:05:02 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//parses epub files
|
2023-05-01 16:24:26 +00:00
|
|
|
fn epub(epub_file: &str){
|
2023-05-02 00:26:22 +00:00
|
|
|
let item_count = 1;
|
2023-05-01 16:24:26 +00:00
|
|
|
println!("{}", epub_file);
|
|
|
|
let doc = EpubDoc::new(&epub_file);
|
|
|
|
assert!(doc.is_ok());
|
2023-05-02 00:26:22 +00:00
|
|
|
let mut doc = doc.unwrap();
|
|
|
|
doc.set_current_page(50);
|
|
|
|
let content = doc.get_current_str();
|
|
|
|
|
|
|
|
|
|
|
|
println!("{:?}", content);
|
|
|
|
|
2023-03-18 01:05:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|