[−][src]Crate bookmarkt
A Netscape Bookmark File format parser.
The name is a subtile mélange between bookmark and book mart. It also works as a mashup with the english book and the german markt.
Quick start
In order to parse a bookmark file, you should use the Netscape struct.
use bookmarkt::Netscape; use serde_json; use std::path::Path; let path = Path::new("./res/netscape.html"); let parsed = Netscape::from_file(path).unwrap(); assert_eq!(parsed.title, "Bookmarks"); assert_eq!(parsed.children.len(), 2);
The bookmarkt structures also support the import and export features.
use bookmarkt::Netscape; use serde_json; use std::path::Path; let path = Path::new("./res/firefox.html"); let imported = Netscape::from_file(path).unwrap(); let exported = imported.to_html().unwrap(); let reimported = Netscape::from_html(&exported).unwrap(); assert_eq!(imported, reimported);
Acknowledgment
bookmarkt
uses the following dependencies :
I really appreciate these works and I hope you appreciate them too ;).
I also took some ideas from these libraries :
Contributing
Open a ticket on the bookmarkt
tracker.
Structs
Bookmark | Implements the specification of the |
Folder | Parses the item formated as a |
Netscape | Implements the Netscape Bookmark File format. |