Fetches a page, discards everything that is not the article, and renders what is left as a self-contained HTML document with no scripts, no stylesheets, no webfonts and no third-party requests. The reader rule in the starter config already points at it. Extraction follows Readability: score p/pre/td/blockquote by prose weight, propagate to ancestors with decay, adjust by class and id names, scale by one minus link density, then take the winner plus sibling nodes that also read like body copy. Serialisation runs against a tag whitelist, with unlisted elements contributing their children but no tag of their own, so wrapper divs disappear. Handling for what real pages actually do: - follow meta http-equiv=refresh stubs, including inside noscript - fall back to data-src when src holds a lazy-load placeholder - take the first srcset candidate, the smallest, not the last - decode via Content-Type charset, then meta charset, then UTF-8 - resolve links against the post-redirect URL so file:// output works - ignore script and style text so a page cannot inflate its own score Output goes to a cache file named by a hash of the URL and opens in $FURST_BROWSER, $BROWSER, or the first light browser on $PATH; --html, --text, --out and --stdin cover the other uses. Restructures the repository as a workspace so the router keeps its two dependencies and its fast build.
15 lines
267 B
TOML
15 lines
267 B
TOML
[package]
|
|
name = "furst-read"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
description = "Strip a web page down to the article and render it as minimal HTML"
|
|
|
|
[dependencies]
|
|
ureq = "3"
|
|
scraper = "0.23"
|
|
encoding_rs = "0.8"
|
|
ego-tree = "0.10.0"
|
|
|
|
[profile.release]
|
|
opt-level = "s"
|