Update README.md
parent
742d3435a3
commit
6c21aa5515
@ -1,71 +1,52 @@
|
|||||||
# reader-view-cli
|
# reader-view-cli
|
||||||
|
|
||||||
**Firefox Reader View in your terminal!**
|
#### Firefox Reader View in your terminal!
|
||||||
|
|
||||||
**reader-view-cli** takes any HTML page and strips out unnecessary bloat by using [Mozilla's Readability library](https://github.com/mozilla/readability). As a result, you get a web page which contains only the core content and nothing more. The resulting HTML is suitable for terminal browsers, text readers, or perhaps other use-cases.
|
**reader-view-cli** takes any HTML page and strips out unnecessary bloat by using [Mozilla's Readability library](https://github.com/mozilla/readability). As a result, you get a web page which contains only the core content and nothing more. The resulting HTML is suitable for terminal browsers, text readers, and other uses.
|
||||||
|
|
||||||
### An example of Reader View in Firefox:
|
### An example of Reader View in Firefox:
|
||||||
|
|
||||||
**Standard view in Firefox**
|
#### Standard view
|
||||||
|
|
||||||
![An article from The Guardian with standard view in Firefox](https://i.imgur.com/6xyyShd.png "Standard view in Firefox")
|
![An article from The Guardian with standard view in Firefox](https://i.imgur.com/6xyyShd.png "Standard view in Firefox")
|
||||||
|
|
||||||
**Reader View in Firefox**
|
#### Reader View
|
||||||
|
|
||||||
![An article from The Guardian with Reader View in Firefox](https://i.imgur.com/V27OUch.png "Reader View in Firefox")
|
![An article from The Guardian with Reader View in Firefox](https://i.imgur.com/V27OUch.png "Reader View in Firefox")
|
||||||
|
|
||||||
#### An example of reader-view-cli with W3M browser:
|
### An example of reader-view-cli with W3M browser:
|
||||||
|
|
||||||
**Standard view in W3M**
|
#### Standard view
|
||||||
|
|
||||||
![An article from The Guardian in W3M](https://i.imgur.com/kAeCfh1.png "Standard view in W3M")
|
![An article from The Guardian in W3M](https://i.imgur.com/kAeCfh1.png "Standard view in W3M")
|
||||||
|
|
||||||
**reader-view-cli + W3M**
|
#### reader-view-cli
|
||||||
|
|
||||||
![An article from The Guardian in W3M using reader-view-cli](https://i.imgur.com/KaSY1JS.png "reader-view-cli with W3M")
|
![An article from The Guardian in W3M using reader-view-cli](https://i.imgur.com/KaSY1JS.png "reader-view-cli with W3M")
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
`readable [SOURCE] [options]`
|
`readable [SOURCE] [options]`
|
||||||
|
|
||||||
`readable [options] -- [SOURCE]`
|
`readable [options] -- [SOURCE]`
|
||||||
(where SOURCE is a file, an http(s) URL, or '-' for standard input)
|
|
||||||
|
where `SOURCE` is a file, an http(s) URL, or '-' for standard input
|
||||||
Options:
|
|
||||||
```
|
See `readable --help` for more information.
|
||||||
--help Print help
|
|
||||||
-o --output OUTPUT_FILE Output to OUTPUT_FILE
|
|
||||||
-p --properties PROPS... Output specific properties of the parsed article
|
### Examples
|
||||||
-V --version Print version
|
|
||||||
-u --url Set the document URL when parsing standard input or a local file (this affects relative links and such)
|
|
||||||
-U --is-url Interpret SOURCE as a URL rather than file name
|
|
||||||
-q --quiet Don't output extra information to stderr
|
|
||||||
```
|
|
||||||
|
|
||||||
The --properties option accepts a comma-separated list of values (with no spaces in-between). Suitable values are:
|
|
||||||
```
|
|
||||||
html-title Outputs the article's title, wrapped in an <h1> tag.
|
|
||||||
title Outputs the title in the format "Title: $TITLE".
|
|
||||||
excerpt Article description, or short excerpt from the content, in the format "Excerpt: $EXCERPT"
|
|
||||||
byline Author metadata, in the format "Author: $AUTHOR"
|
|
||||||
length Length of the article in characters, in the format "Length: $LENGTH"
|
|
||||||
dir Content direction, is either "Direction: ltr" or "Direction: rtl"
|
|
||||||
html-content Outputs the article's main content as HTML.
|
|
||||||
text-content Outputs the article's main content as plain text.
|
|
||||||
```
|
|
||||||
|
|
||||||
Text-content and Html-content are mutually exclusive, and are always printed last.
|
|
||||||
Default value is "html-title,html-content".
|
|
||||||
|
|
||||||
|
|
||||||
### Usage examples
|
|
||||||
|
|
||||||
**Read HTML from a file and output the result to the console:**
|
**Read HTML from a file and output the result to the console:**
|
||||||
|
|
||||||
`readable index.html`
|
`readable index.html`
|
||||||
|
|
||||||
**Fetch a web page and read it in W3M:**
|
**Fetch a web page and read it in W3M:**
|
||||||
|
|
||||||
`readable https://example.com/page | w3m -T text/html`
|
`readable https://example.com/page | w3m -T text/html`
|
||||||
|
|
||||||
**Download a web page using cURL, get the title, the content, and an excerpt in plain text:**
|
**Download a web page using cURL, get the title, the content, and an excerpt in plain text:**
|
||||||
`curl https://example.com/page | readable --url https://example.com/page -p title,excerpt,text-content`
|
|
||||||
|
`curl https://example.com/page | readable --url=https://example.com/page -p title,excerpt,text-content`
|
||||||
|
|
||||||
It's a good idea to supply the --url parameter when piping input, otherwise `readable` won't know the document's URL, and things like relative links won't work.
|
It's a good idea to supply the --url parameter when piping input, otherwise `readable` won't know the document's URL, and things like relative links won't work.
|
||||||
|
Loading…
Reference in New Issue