Skip to content
/ gmi2html Public

Ruby gem to convert gemtext/gmi files to html

License

Notifications You must be signed in to change notification settings

jebw/gmi2html

Repository files navigation

Gmi2html

This is a pure ruby Gemtext to HTML convertor, relying on the gemtext gem

Gemini

Gemtext is a simple plain text format, similar to Markdown but simpler. It is the official format for pages within Gemini capsules.

For more information on Gemini see the official page

Gemini official page Gemini specification

I've written a separate gem - jekyll-gemini which uses this gem for publishing from your Jekyll blog to a Gemini capsule.

Using Gmi2html

To convert a Gemtext string to an html string

require 'gmi2html'

html_string = Gmi2html::Document.new(my_gemtext_string).to_html

To convert a Gemtext file to an html string

require 'gmi2html'

html_string = File.open('capsule/my_gemtext.gmi', 'r') do |f|
  Gmi2html::Document.new(f).to_html
end

Status

Second release but should be feature complete

Supported

  • Paragraphs
  • Headings
  • Quotes
  • Whitespace
  • List items
  • Preformatted text
  • Syntax highlighted preformatted text

About

Ruby gem to convert gemtext/gmi files to html

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages