Geminut is a simple CLI software to convert a gemlog (aka gemini capsule) to HTML or markdown. The goal is to make a simplified process for the user writing in gemini specfied syntax to be able to simultaneously post to a gemlog, HTML and markdown
Go to file
exquisitecorp 2a85c8b654 add site rebuilder / updater update-fish.fish 2024-03-24 22:04:21 -05:00
LICENSE.gmi added anti-capitalist software LICENSE.gmi and geminut-produced LICENSE.md 2021-02-17 13:07:12 -05:00
LICENSE.md added anti-capitalist software LICENSE.gmi and geminut-produced LICENSE.md 2021-02-17 13:07:12 -05:00
README.md minor change to description on geminut.gmi, then converted to README.md and index.html 2021-02-17 04:30:05 -05:00
gemini-icon.svg initial commit 2021-02-17 04:00:48 -05:00
geminut.gmi minor change to description on geminut.gmi, then converted to README.md and index.html 2021-02-17 04:30:05 -05:00
geminut.js fix order of ul li li ul wrappers 2021-08-28 13:47:27 -04:00
gmi.css initial commit 2021-02-17 04:00:48 -05:00
index.html minor change to description on geminut.gmi, then converted to README.md and index.html 2021-02-17 04:30:05 -05:00
screenshot.jpg initial commit 2021-02-17 04:00:48 -05:00
update-site.fish add site rebuilder / updater update-fish.fish 2024-03-24 22:04:21 -05:00

README.md

Geminut, a Gemini -> HTML and Markdown converter in Node.js

   ______               _             __ 
  / ____/__  ____ ___  (_)___  __  __/ /_
 / / __/ _ \/ __ `__ \/ / __ \/ / / / __/
/ /_/ /  __/ / / / / / / / / / /_/ / /_  
\____/\___/_/ /_/ /_/_/_/ /_/\__,_/\__/  

Geminut is a simple CLI software to convert a gemlog (aka gemini capsule) to HTML or markdown. The goal is to make a simplified process for the user writing in gemini specfied syntax to be able to simultaneously post to a gemlog as well as a simple HTML blog or git repo or markdown documentation without having to hand convert.

This documentation was written in gemtext and then converted via Geminut if you are currently reading this in HTML or markdown. See the gemini README source file for the original if you're viewing this on the web or in markdown. The HTML output includes a gemini syntax-like css stylesheet.

Usage

node geminut.js input.gmi output.html

OR

node geminut.js input.gmi output.md

Screenshot

Screenshot of HTML output

Method

gmi links are converted to .html and .md depending on output choice, as it's expected this is to be used to convert a blog. Links for HTML are wrapped in paragraph tags to ease readability of converted page. List items and links get an added newline break when converted to markdown to ease readability.

HTML outputs a head section and wraps output inside body, inside proper html doctype. It includes a gmi.css stylesheet by default.

Similar projects

I have not used any of these but you may wish to check these as well:

gemini-pandoc-lua-filter - A Lua filter for pandoc to output gemini text.

gemini to html - another node.js library

gmitohtml - conversion to HTML and daemon in Golang

gmi2html - conversion to HTML in Zig

Hugo to gemini - converts Hugo blogs to gemini

md2gemini - a CLI program and Python module to convert markdown to gemini by the creator of the Amfora gemini client

Notes and Resources

Gemini spec syntax

  • Gemini unordered list items * are converted to their own individual list in HTML rather than added to a larger list.

I consulted this Simple Markdown Parser with JavaScript and Regular Expressions for starter code

I learned figcaption is the proper way to caption photos in HTML

The stylesheet file was adapted from gmi-web, a public domain project