-
Notifications
You must be signed in to change notification settings - Fork 4
/
doc.go
60 lines (48 loc) · 1.3 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
Package goskirt provides Go-bindings for the excellent Sundown markdown parser
(F/K/A Upskirt).
To use goskirt, create a new Goskirt-value with the markdown extensions and
render modes you want. The extensions and render modes are encapsulated in the
struct as bitsets following the schematics of the Sundown library. The created
value contains two methods: WriteHTML and WriteTOC that both parse the data
given in a byte slice and writes the formatted results into the given io.Writer
using the setup encapsuled in the underlaying struct type.
Usage:
package main
import (
"goskirt"
"os"
)
func main() {
data := []byte("Hello, sundown!\n===============\n")
skirt := goskirt.Goskirt{
goskirt.EXT_AUTOLINK | goskirt.EXT_STRIKETHROUGH,
goskirt.HTML_SMARTYPANTS | goskirt.HTML_USE_XHTML,
}
// <h1>Hello, sundown!</h1>
skirt.WriteHTML(os.Stdout, data)
}
Render mode is a combination of:
HTML_SKIP_HTML
HTML_SKIP_STYLE
HTML_SKIP_IMAGES
HTML_SKIP_LINKS
HTML_EXPAND_TABS
HTML_SAFELINK
HTML_TOC
HTML_HARD_WRAP
HTML_USE_XHTML
HTML_ESCAPE
HTML_SMARTYPANTS
... and the extensions respectively:
EXT_NO_INTRA_EMPHASIS
EXT_TABLES
EXT_FENCED_CODE
EXT_AUTOLINK
EXT_STRIKETHROUGH
EXT_SPACE_HEADERS
EXT_SUPERSCRIPT
EXT_LAX_SPACING
See LICENSE file for licensing details.
*/
package goskirt