Cli tool for converting gemini markup text (.gmi) to HTML.

Björn Wärmedal 141c397896 Fixed bug where preform lines got an extra \n 2 years ago
gmi2html 141c397896 Fixed bug where preform lines got an extra \n 2 years ago
.gitignore 714fcf510a gmi2html.convert now takes a string array as input instead of filename 2 years ago
LICENSE c9e8fa8a88 Added a license like a baws 3 years ago
README.md 7425b3788e Updated README 2 years ago
setup.cfg 141c397896 Fixed bug where preform lines got an extra \n 2 years ago
setup.py 1ab956229a gmi2html installable with pip and usable as lib 2 years ago

README.md

Gemini tool: gmi2html

I couldn't find a tool for converting gemini markup to html. I'm sure there are many, but my searching skills failed me.

Anyways, writing one is trivial, so I did just that. Maybe you don't have to do the same now :D

Installation

pip3 install git+https://notabug.org/tinyrabbit/gmi2html.git#egg=gmi2html

Command Line Usage

usage: gmi2html [-h] [--inline-img] [F [F ...]]

Convert text/gemini to text/html, print to stdout.

positional arguments:
  F             All files to convert. (Leave empty or '-' for stdin)

optional arguments:
  -h, --help    show this help message and exit
  --inline-img  Inline png, jpg/jpeg, gif, webp, svg links.

Both of the following examples produce the same output:

gmi2html testfile.gmi

and

cat testfile.gmi | gmi2html

Link text for inline images will be added as the alt='' attribute in the img tag.

Library Usage

import gmi2html

gmi2html.convert(files, inlineImg)

Note that this will print to stdout. I have yet to implement an output argument.

Pull Requests are Welcome!

It's still going to be a tiny tool, but tell me if you have ideas for improvements.

Credits

Thanks to Solène (@solene@bsd.network) for feature suggestions and bug fixes!