-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add reader mode for simplifying pages
- Loading branch information
Mauve Signweaver
committed
Aug 29, 2023
1 parent
c0b3211
commit 56fc68b
Showing
7 changed files
with
65 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,3 +108,4 @@ bundle-gemini.js | |
bundle-json.js | ||
bundle-markdown.js | ||
bundle-ssb.js | ||
bundle-reader.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const renderPage = require('./template.js') | ||
const {Readability} = require('@mozilla/readability') | ||
|
||
const article = new Readability(document).parse() | ||
|
||
const { title, content, byline } = article | ||
|
||
const finalContent = ` | ||
<h1>${title}</h1> | ||
<p> | ||
${byline} | ||
</p> | ||
<hr> | ||
${content} | ||
` | ||
|
||
renderPage(finalContent, title) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.