- Updated documentation
This commit is contained in:
parent
e93cf49694
commit
a2777e0737
@ -1,8 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Program: Bibliofile
|
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.
|
Purpose: This class is meant to process and return HTML formatted text as strings.
|
||||||
Last edited: 6/28/23
|
Last edited: 6/28/23
|
||||||
*/
|
*/
|
||||||
@ -13,10 +10,13 @@ pub fn main(content: String){
|
|||||||
|
|
||||||
|
|
||||||
let str_content = Html::parse_document(&content);
|
let str_content = Html::parse_document(&content);
|
||||||
let selector = Selector::parse("html").unwrap();
|
|
||||||
|
|
||||||
|
//Selector is HTML tag. Can be <br> or <p> or anything else. To parse entire page, set selector to <html>
|
||||||
|
let selector = Selector::parse("html").unwrap();
|
||||||
let unwrapped_page = str_content.select(&selector).next().unwrap();
|
let unwrapped_page = str_content.select(&selector).next().unwrap();
|
||||||
let page = unwrapped_page.text().collect::<Vec<_>>();
|
let page = unwrapped_page.text().collect::<Vec<_>>();
|
||||||
|
|
||||||
|
//every line in document is an entry into the vector. For loop iterates through every entry and displays it.
|
||||||
for i in 0..page.len() {
|
for i in 0..page.len() {
|
||||||
println!("{}", page[i]);
|
println!("{}", page[i]);
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
Program: Bibliofile
|
Program: Bibliofile
|
||||||
Language: Rustc 1.69.0
|
Language: Rustc 1.70.0
|
||||||
ide: CLion
|
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/19/23
|
Last edited: 6/28/23
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user