Skip to content

Latest commit

 

History

History
56 lines (39 loc) · 927 Bytes

README.md

File metadata and controls

56 lines (39 loc) · 927 Bytes

gom2h

convert markdown to html

Usage

As a cli tool

$ go get -u github.com/matsuyoshi30/gom2h/cmd/gom2h # Installation

$ gom2h <path/to/markdownfile>

$ gom2h -css <path/to/cssfile> <path/to/markdownfile> # specify css

default css


As a go library

$ go get -u github.com/matsuyoshi30/gom2h # Installation
import (
        "fmt"

        "github.com/matsuyoshi30/gom2h"
)

func main() {
        output, err := gom2h.Run([]byte(`### Header3 with *em* and **strong**`))
        if err != nil {
                fmt.Println(err)
        }
        fmt.Println(string(output)) // -> <h3>Header3 with <em>em</em> and <strong>strong</strong></h3>
}

Support

  • Header
  • Paragraph
  • Emphasis
  • Strong
  • Link
  • List (Unorder)
  • Code Block
    • Syntax highlight (only when converting file)

License

MIT