Added HTML framework and module.
Found HTML crate. This crate will allow me to render the HTML syntax to the TUI.
This commit is contained in:
parent
0426525804
commit
e7dfddc8f8
@ -6,4 +6,5 @@ edition = "2021"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
epub = "1.2.2"
|
||||
epub = "1.2.2"
|
||||
horrorshow = "0.8.4"
|
||||
|
17
src/html_module.rs
Normal file
17
src/html_module.rs
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
Program: Bibliofile
|
||||
Language: Rustc 1.69.0
|
||||
ide: CLion
|
||||
Operating system: Fedora 38/WSL
|
||||
Purpose: This class is meant to process and return HTML formatted text as strings.
|
||||
Last edited: 5/15/23
|
||||
*/
|
||||
|
||||
extern crate horrorshow;
|
||||
use horrorshow::prelude::*;
|
||||
use horrorshow::helper::doctype;
|
||||
|
||||
|
||||
pub fn main(){
|
||||
println!("if you can read this, you reached the HTML class.");
|
||||
}
|
20
src/main.rs
20
src/main.rs
@ -1,17 +1,20 @@
|
||||
/*
|
||||
Program: Bibliofile
|
||||
Language: Rustc 1.69.0
|
||||
ide: Visual Studio Code
|
||||
ide: CLion
|
||||
Operating system: Fedora 38/WSL
|
||||
Purpose: ncurses based ereader and library manager for Linux terminal environments.
|
||||
Last edited: 5/1/23
|
||||
Last edited: 5/15/23
|
||||
*/
|
||||
|
||||
use epub::doc::EpubDoc;
|
||||
|
||||
mod html_module;
|
||||
use epub::doc::EpubDoc; //library for navigating epubs
|
||||
use std::env;
|
||||
use std::io;
|
||||
|
||||
|
||||
|
||||
//initial function. Reads the ebook passed by argument.
|
||||
//TODO: add visual library to pull up ebooks.
|
||||
fn main() {
|
||||
@ -31,19 +34,20 @@ fn epub(epub_file: &str){
|
||||
doc.set_current_page(50);
|
||||
let content = doc.get_current_str();
|
||||
|
||||
while(true){
|
||||
//while true{
|
||||
let mut next = String::new();
|
||||
|
||||
io::stdin()
|
||||
.read_line(&mut next)
|
||||
.expect("Failed to read line");
|
||||
if next == "n"{
|
||||
//if next == "n"{
|
||||
doc.go_next();
|
||||
println!("{:?}", content);
|
||||
}
|
||||
//}
|
||||
|
||||
html_module::main();
|
||||
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user