Skip to content

LukeEmmet/html2gemini

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
This branch is 35 commits ahead, 3 commits behind jaytaylor:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

html2gemini

A Go library to converts HTML into Gemini text/gemini (gemtext)

This is forked from https://jaytaylor.com/html2text with the following changes:

  • output text/gemini format
  • use footnote style references

Introduction

Turns HTML into text/gemini to be served over gemini, or incorporated into a client.

html2gemini is a simple golang package for rendering HTML into plaintext.

Download the package

go get github.com/LukeEmmet/html2gemini

Example usage

See https://github.com/LukeEmmet/html2gmi which is a practical command line application that uses this library. Also see https://github.com/LukeEmmet/duckling-proxy which is an HTTP via Gemini proxy server so you can browse the web from any Gemini client that supports scheme-specific proxies.

To simplify the html passed to this library, you could simplify or sanitise it first, for example using https://github.com/philipjkim/goreadability

Unit-tests

Running the unit-tests is straightforward and standard:

go test

License

Permissive MIT license.

Contact

Email: luke [at] marmaladefoo [dot] com

If you appreciate this library please feel free to drop me a line and tell me, and please send a note of appreciation to Jay Taylor (url below) who wrote the original html2text on which this is based, and who should receive most of the credit.

https://jaytaylor.com/html2text

About

Golang HTML to Gemini (text/gemini) conversion library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%