summaryrefslogtreecommitdiff
path: root/examples/gmi2md
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-01-14 19:59:12 -0700
committertjpcc <tjp@ctrl-c.club>2023-01-14 19:59:12 -0700
commitcec3718bdd089bcf58575740c5ae4f86b27226d1 (patch)
tree497733255e0459d2a6bcbd059ea3e124d602d1b2 /examples/gmi2md
parent88b98dcf18f9bc9b098a574c96deabf9d323a997 (diff)
markdown converter
Diffstat (limited to 'examples/gmi2md')
-rw-r--r--examples/gmi2md/main.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/gmi2md/main.go b/examples/gmi2md/main.go
new file mode 100644
index 0000000..386983a
--- /dev/null
+++ b/examples/gmi2md/main.go
@@ -0,0 +1,20 @@
+package main
+
+import (
+ "log"
+ "os"
+
+ "tildegit.org/tjp/gus/gemtext"
+ "tildegit.org/tjp/gus/gemtext/mdconv"
+)
+
+func main() {
+ gmiDoc, err := gemtext.Parse(os.Stdin)
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ if err := mdconv.Convert(os.Stdout, gmiDoc, nil); err != nil {
+ log.Fatal(err)
+ }
+}