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 години | |
---|---|---|
gmi2html | преди 2 години | |
.gitignore | преди 2 години | |
LICENSE | преди 2 години | |
README.md | преди 2 години | |
setup.cfg | преди 2 години | |
setup.py | преди 2 години |
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
pip3 install git+https://notabug.org/tinyrabbit/gmi2html.git#egg=gmi2html
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.
import gmi2html
gmi2html.convert(files, inlineImg)
Note that this will print to stdout. I have yet to implement an output argument.
It's still going to be a tiny tool, but tell me if you have ideas for improvements.
Thanks to Solène (@solene@bsd.network) for feature suggestions and bug fixes!