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

=> . ..

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

2021-02-17

=> images/gemini-icon.svg

=> https://tildegit.org/exquisitecorp/geminut Geminut repo on Tildegit

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

=> images/screenshot.jpg 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: 

=> https://github.com/kr1sp1n/gemini-pandoc-lua-filter gemini-pandoc-lua-filter - A Lua filter for pandoc to output gemini text.
=> https://github.com/RangerMauve/gemini-to-html gemini to html - another node.js library
=> https://gitlab.com/tslocum/gmitohtml gmitohtml - conversion to HTML and daemon in Golang
=> https://github.com/shtanton/gmi2html gmi2html - conversion to HTML in Zig
=> https://git.tdem.in/tdemin/gmnhg Hugo to gemini - converts Hugo blogs to gemini
=> https://github.com/makeworld-the-better-one/md2gemini md2gemini - a CLI program and Python module to convert markdown to gemini by the creator of the Amfora gemini client 

## Notes and Resources 

=> https://gemini.circumlunar.space/docs/specification.html Gemini spec syntax
* Gemini unordered list items * are converted to their own individual list in HTML rather than added to a larger list. 
=> https://medium.com/javascript-in-plain-english/simple-markdown-parser-with-javascript-and-regular-expressions-f0c8d53449a4 I consulted this Simple Markdown Parser with JavaScript and Regular Expressions for starter code
=> https://www.w3schools.com/TAGS/tag_figcaption.asp I learned figcaption is the proper way to caption photos in HTML
=> https://codeberg.org/talon/gmi-web The stylesheet file was adapted from gmi-web, a public domain project
