Updated epub library to latest version

This commit is contained in:
Daniel Redd Jones 2023-05-29 17:41:05 -05:00
parent 471f435269
commit 13d6b85165
4 changed files with 8 additions and 7 deletions

View File

@ -6,6 +6,6 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
epub = "1.2.2"
epub = "2.0.0"
ncurses = "5.101.0"
soup = "0.5.1"

View File

@ -15,7 +15,7 @@ Last edited: 5/20/23
*/
use soup::{Soup};
pub fn main(content: String) -> String {
pub fn main(content: &str) -> String {
let str_content = content;
let soup = Soup::new(&str_content);
let page = soup.text();

View File

@ -41,12 +41,11 @@ fn epub_func(epub_file: &str){
let is_reading = true;
while is_reading == true {
let mut next_or_last = String::new();
doc.set_current_page(page_num).expect("end of book");
doc.set_current_page(page_num);
let content = doc.get_current_str();
let str_content = content.unwrap();
let page = html_module::main(str_content);
println!("{}", page);
let page = html_module::main(&str_content.0);
ncurses_module::main(page);
let input_size = std::io::stdin().read_line(&mut next_or_last);

View File

@ -11,10 +11,12 @@ Last edited: 5/20/23
use ncurses;
use ncurses::{initscr, WINDOW};
pub fn main(text: String) {
pub fn main(mut text: String) {
ncurses::clear();
initscr();
ncurses::addstr(&*text);
ncurses::refresh();
println!("If you can read this, you are in the ncurses_module");
}