github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/libraries/html2md/README.md (about) 1 2 Html2md is an implementation of converting html to markdown for Go. 3 4 # Installation 5 6 If you have [gopm](https://github.com/gpmgo/gopm) installed, 7 8 gopm get github.com/lunny/html2md 9 10 Or 11 12 go get github.com/lunny/html2md 13 14 # Usage 15 16 * Html2md has some html tag Rules. For simple use, just use 17 18 ```Go 19 md := html2md.Convert(html) 20 ``` 21 22 * If you want to use your self Rule. You can 23 24 ```Go 25 html2md.AddRule(&html2md.Rule{ 26 patterns: []string{"hr"}, 27 tp: Void, 28 replacement: func(innerHTML string, attrs []string) string { 29 return "\n\n* * *\n" 30 }, 31 }) 32 ``` 33 34 or 35 36 ```Go 37 html2md.AddConvert(func(conent string) string { 38 return strings.ToLower(content) 39 }) 40 ``` 41 42 # Documents 43 44 * [GoDoc](http://godoc.org/github.com/lunny/html2md) 45 46 * [GoWalker](http://gowalker.org/github.com/lunny/html2md) 47 48 # LICENSE 49 50 BSD License 51 [http://creativecommons.org/licenses/BSD/](http://creativecommons.org/licenses/BSD/)