summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimanshu Sardana <himanshusardana2005@gmail.com>2026-03-16 18:28:53 +0000
committerHimanshu Sardana <himanshusardana2005@gmail.com>2026-03-16 18:28:53 +0000
commit86f46ef995ca47a33590366b41dc299619bf81f0 (patch)
treed44f04db639864472ed3f7513edc82d9c01cc176
parente39483c49db06b6157968bfaaa66180517d022f3 (diff)
feat: add basic markdown parsing
-rw-r--r--go.mod2
-rw-r--r--go.sum2
-rw-r--r--main.go20
3 files changed, 22 insertions, 2 deletions
diff --git a/go.mod b/go.mod
index ca9342b..7144e83 100644
--- a/go.mod
+++ b/go.mod
@@ -1,3 +1,5 @@
module kite
go 1.25.0
+
+require github.com/gomarkdown/markdown v0.0.0-20260217112301-37c66b85d6ab
diff --git a/go.sum b/go.sum
new file mode 100644
index 0000000..52d2bfd
--- /dev/null
+++ b/go.sum
@@ -0,0 +1,2 @@
+github.com/gomarkdown/markdown v0.0.0-20260217112301-37c66b85d6ab h1:VYNivV7P8IRHUam2swVUNkhIdp0LRRFKe4hXNnoZKTc=
+github.com/gomarkdown/markdown v0.0.0-20260217112301-37c66b85d6ab/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA=
diff --git a/main.go b/main.go
index 02a1288..6cf7c19 100644
--- a/main.go
+++ b/main.go
@@ -1,7 +1,23 @@
package main
-import "fmt"
+import (
+ "fmt"
+ "os"
+ "path/filepath"
+
+ "github.com/gomarkdown/markdown"
+ // "github.com/gomarkdown/markdown/html"
+ // "github.com/gomarkdown/markdown/parser"
+)
func main() {
- fmt.Println("testing")
+ path := filepath.Join("./test.md")
+ mds, err := os.ReadFile(path)
+ if err != nil {
+ fmt.Println("Error %s", err)
+ }
+ md := []byte(mds)
+ html := markdown.ToHTML(md, nil, nil)
+
+ fmt.Printf("--- Markdown:\n%s\n\n--- HTML:\n%s\n", md, html)
}