mirror of
https://github.com/yuin/goldmark
synced 2025-03-04 23:04:52 +00:00
Update README.md
To simplify a copy-paste.
This commit is contained in:
parent
ddce9bf23e
commit
9cf9f6802e
1 changed files with 26 additions and 2 deletions
28
README.md
28
README.md
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in a new issue