Browse Source

Added badges and some docs

main v1.0.2
gryffyn 5 months ago
parent
commit
2ebe03d709
Signed by: gryffyn GPG Key ID: 6948DD6514D02BEF
  1. 4
      README.md
  2. 3
      md2gmi.go

4
README.md

@ -1,5 +1,7 @@
# md2gmi
[![Go Report Card](https://goreportcard.com/badge/git.neveris.one/gryffyn/md2gmi)](https://goreportcard.com/report/git.neveris.one/gryffyn/md2gmi) [![Go Reference](https://pkg.go.dev/badge/git.neveris.one/gryffyn/md2gmi.svg)](https://pkg.go.dev/git.neveris.one/gryffyn/md2gmi) ![License](https://img.shields.io/badge/license-MIT--%E2%89%A01-informational?style=flat) [![Build Status](https://ci.neveris.one/api/badges/gryffyn/md2gmi/status.svg?ref=refs/heads/main)](https://ci.neveris.one/gryffyn/md2gmi)
Small Go tool to convert Github markdown (plus HTML and Hugo shortcodes) to Gemini text files.
## Installing
@ -14,4 +16,4 @@ The binary will be in `$GOPATH/bin`.
Run `md2gmi -h` to show the built in help.
`md2gmi` has two positional arguments, the input markdown (usually `.md`) and the output Gemtext file (usually `.gmi`).
Basic usage is `md2gmi input.md output.gmi`.
Basic usage is `md2gmi input.md output.gmi`.

3
md2gmi.go

@ -22,6 +22,9 @@ func ofile(filename, str string) error {
return err
}
// Converts .md to .gmi using regexes
// Supports citations, html tags, and hyperlinks
func md2gmi(md string) string {
// defines regexes and compiles them
reg_html := regexp.MustCompile(`<.+?>.+?<\/.+?>`)

Loading…
Cancel
Save