Converts Markdown to Gemini gemtext with Go. Working with streams and UNIX pipes, utilizing Go channels. Processes streams of input line by line and forwards blocks to the next pipeline stage.
Find a file
2021-07-04 12:43:13 +08:00
main.go toy with pipeline setup 2021-07-04 12:43:13 +08:00
parser.go toy with some ideas 2021-07-04 12:31:51 +08:00
pipeline.go toy with pipeline setup 2021-07-04 12:43:13 +08:00
README.md toy with some ideas 2021-07-04 12:31:51 +08:00

md2gmi

Convert Markdown to Gemini gemtext markup with Go. Working with streams and pipes for UNIX like behavior utilizing Go channels. Processing streams line by line is deliberately slightly more challenging than it needs to be to play around with go state machines.

See the gemini protocol.

Internally md2gmi does a 1st pass that constructs the core layout for gemtext. This is then streamed to the 2nd pass line by line. The 2nd pass will convert links and stream line by line to the output.

Usage

Usage of ./md2gmi:
  -in string
        specify a .md (Markdown) file to read from, otherwise stdin (default)
  -out string
        specify a .gmi (gemtext) file to write to, otherwise stdout (default)

Example

go get github.com/n0x1m/md2gmi
cat file.md | md2gmi
md2gmi -in file.md -out file.gmi