Updated epub library to latest version
This commit is contained in:
parent
471f435269
commit
13d6b85165
@ -6,6 +6,6 @@ edition = "2021"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
epub = "1.2.2"
|
epub = "2.0.0"
|
||||||
ncurses = "5.101.0"
|
ncurses = "5.101.0"
|
||||||
soup = "0.5.1"
|
soup = "0.5.1"
|
||||||
|
@ -15,7 +15,7 @@ Last edited: 5/20/23
|
|||||||
*/
|
*/
|
||||||
use soup::{Soup};
|
use soup::{Soup};
|
||||||
|
|
||||||
pub fn main(content: String) -> String {
|
pub fn main(content: &str) -> String {
|
||||||
let str_content = content;
|
let str_content = content;
|
||||||
let soup = Soup::new(&str_content);
|
let soup = Soup::new(&str_content);
|
||||||
let page = soup.text();
|
let page = soup.text();
|
||||||
|
@ -41,12 +41,11 @@ fn epub_func(epub_file: &str){
|
|||||||
let is_reading = true;
|
let is_reading = true;
|
||||||
while is_reading == true {
|
while is_reading == true {
|
||||||
let mut next_or_last = String::new();
|
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 content = doc.get_current_str();
|
||||||
let str_content = content.unwrap();
|
let str_content = content.unwrap();
|
||||||
let page = html_module::main(str_content);
|
let page = html_module::main(&str_content.0);
|
||||||
println!("{}", page);
|
|
||||||
ncurses_module::main(page);
|
ncurses_module::main(page);
|
||||||
|
|
||||||
let input_size = std::io::stdin().read_line(&mut next_or_last);
|
let input_size = std::io::stdin().read_line(&mut next_or_last);
|
||||||
|
@ -11,10 +11,12 @@ Last edited: 5/20/23
|
|||||||
use ncurses;
|
use ncurses;
|
||||||
use ncurses::{initscr, WINDOW};
|
use ncurses::{initscr, WINDOW};
|
||||||
|
|
||||||
pub fn main(text: String) {
|
pub fn main(mut text: String) {
|
||||||
|
|
||||||
|
|
||||||
|
ncurses::clear();
|
||||||
initscr();
|
initscr();
|
||||||
ncurses::addstr(&*text);
|
ncurses::addstr(&*text);
|
||||||
|
|
||||||
|
ncurses::refresh();
|
||||||
println!("If you can read this, you are in the ncurses_module");
|
println!("If you can read this, you are in the ncurses_module");
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user