Update README.md

To simplify a copy-paste.
This commit is contained in:
Alexey Mironov 2019-05-19 07:41:10 +03:00 committed by GitHub
parent ddce9bf23e
commit 9cf9f6802e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,8 +50,24 @@ Features
task lists, and definition lists.
- **Depends only on standard libraries.**
Installation
----------------------
```bash
$ go get github.com/yuin/goldmark
```
Usage
----------------------
Import packages:
```
import (
"bytes"
"github.com/yuin/goldmark"
)
```
Convert Markdown documents with the CommonMark compliant mode:
@ -62,9 +78,17 @@ if err := goldmark.Convert(source, &buf); err != nil {
}
```
Customize a parser and a renderer:
Custom parser and renderer
--------------------------
```go
import (
"bytes"
"github.com/yuin/goldmark"
"github.com/yuin/goldmark/extension"
"github.com/yuin/goldmark/parser"
"github.com/yuin/goldmark/renderer/html"
)
md := goldmark.New(
goldmark.WithExtensions(extension.GFM),
goldmark.WithParserOptions(