mirror of
https://github.com/yuin/goldmark
synced 2025-03-04 23:04:52 +00:00
commit
9b1570bcde
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.
|
task lists, and definition lists.
|
||||||
- **Depends only on standard libraries.**
|
- **Depends only on standard libraries.**
|
||||||
|
|
||||||
|
Installation
|
||||||
|
----------------------
|
||||||
|
```bash
|
||||||
|
$ go get github.com/yuin/goldmark
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
----------------------
|
----------------------
|
||||||
|
Import packages:
|
||||||
|
|
||||||
|
```
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"github.com/yuin/goldmark"
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Convert Markdown documents with the CommonMark compliant mode:
|
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
|
```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(
|
md := goldmark.New(
|
||||||
goldmark.WithExtensions(extension.GFM),
|
goldmark.WithExtensions(extension.GFM),
|
||||||
goldmark.WithParserOptions(
|
goldmark.WithParserOptions(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue