Minor edits to new custom reader example.
This commit is contained in:
parent
1be49f11f7
commit
039c7e925a
1 changed files with 7 additions and 5 deletions
|
@ -683,7 +683,7 @@ function Reader (input, opts)
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
# Example: "readable HTML" reader
|
# Example: extracting the content from web pages
|
||||||
|
|
||||||
This reader uses the command-line program `readable`
|
This reader uses the command-line program `readable`
|
||||||
(install via `npm install -g readability-cli`)
|
(install via `npm install -g readability-cli`)
|
||||||
|
@ -691,10 +691,12 @@ to clean out parts of HTML input that have to do with
|
||||||
navigation, leaving only the content.
|
navigation, leaving only the content.
|
||||||
|
|
||||||
``` lua
|
``` lua
|
||||||
-- Custom reader for "readable HTML." This pipes HTML content
|
-- Custom reader that extracts the content from HTML documents,
|
||||||
-- through the 'readable' program (npm install -g readability-cli)
|
-- ignoring navigation and layout elements. This preprocesses input
|
||||||
-- and then calls the HTML reader. In addition, Divs that seem
|
-- through the 'readable' program (which can be installed using
|
||||||
-- to have only a layout function are removed to avoid clutter.
|
-- 'npm install -g readability-cli') and then calls the HTML reader.
|
||||||
|
-- In addition, Divs that seem to have only a layout function are removed
|
||||||
|
-- to avoid clutter.
|
||||||
|
|
||||||
function make_readable(source)
|
function make_readable(source)
|
||||||
local result
|
local result
|
||||||
|
|
Loading…
Reference in a new issue