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
@ -7,3 +7,4 @@ edition = "2021"
|
|||||||
|
|
||||||
[dependencies]
|
[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.");
|
||||||
|
}
|
18
src/main.rs
18
src/main.rs
@ -1,17 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
Program: Bibliofile
|
Program: Bibliofile
|
||||||
Language: Rustc 1.69.0
|
Language: Rustc 1.69.0
|
||||||
ide: Visual Studio Code
|
ide: CLion
|
||||||
Operating system: Fedora 38/WSL
|
Operating system: Fedora 38/WSL
|
||||||
Purpose: ncurses based ereader and library manager for Linux terminal environments.
|
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::env;
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//initial function. Reads the ebook passed by argument.
|
//initial function. Reads the ebook passed by argument.
|
||||||
//TODO: add visual library to pull up ebooks.
|
//TODO: add visual library to pull up ebooks.
|
||||||
fn main() {
|
fn main() {
|
||||||
@ -31,19 +34,20 @@ fn epub(epub_file: &str){
|
|||||||
doc.set_current_page(50);
|
doc.set_current_page(50);
|
||||||
let content = doc.get_current_str();
|
let content = doc.get_current_str();
|
||||||
|
|
||||||
while(true){
|
//while true{
|
||||||
let mut next = String::new();
|
let mut next = String::new();
|
||||||
|
|
||||||
io::stdin()
|
io::stdin()
|
||||||
.read_line(&mut next)
|
.read_line(&mut next)
|
||||||
.expect("Failed to read line");
|
.expect("Failed to read line");
|
||||||
if next == "n"{
|
//if next == "n"{
|
||||||
doc.go_next();
|
doc.go_next();
|
||||||
println!("{:?}", content);
|
println!("{:?}", content);
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
html_module::main();
|
||||||
|
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user