npm install @mozilla/readability jsdom
go install github.com/LukeEmmet/html2gmi@master
curl https://www.bortzmeyer.org/gemini.html | node main.js | html2gmi -l 1 > output.gmi
Created
December 28, 2021 23:02
-
-
Save JeanRibes/fbcc0349d3e0ed6c0e25b72cf89fdc6a to your computer and use it in GitHub Desktop.
convert HTML to Gemini markup through Firefox's Reading Mode
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
var { Readability } = require('@mozilla/readability'); | |
var { JSDOM } = require('jsdom'); | |
var fs = require('fs'); | |
let data = fs.readFileSync(0, 'utf-8'); | |
var doc = new JSDOM(data, { | |
url: "http://example.com" | |
}); | |
let reader = new Readability(doc.window.document); | |
let article = reader.parse(); | |
console.log(article.content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment