mirror of
https://github.com/avelino/awesome-go.git
synced 2024-12-12 17:13:58 +00:00
* fix gfm compat Signed-off-by: Kirill Danshin <k@guava.by> * fix .travis.yml Signed-off-by: Kirill Danshin <k@guava.by> * requested changes Signed-off-by: Kirill Danshin <k@guava.by>
This commit is contained in:
parent
7f3a74f4b6
commit
8a0043468c
@ -6,7 +6,4 @@ go:
|
||||
sudo: false
|
||||
|
||||
install:
|
||||
- go get github.com/russross/blackfriday
|
||||
- go get github.com/PuerkitoBio/goquery
|
||||
- go get github.com/gorilla/mux
|
||||
- go get github.com/microcosm-cc/bluemonday
|
||||
- go get -t -v ./...
|
||||
|
36
repo.go
36
repo.go
@ -8,8 +8,7 @@ import (
|
||||
"text/template"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/microcosm-cc/bluemonday"
|
||||
"github.com/russross/blackfriday"
|
||||
gfm "github.com/shurcooL/github_flavored_markdown"
|
||||
)
|
||||
|
||||
// memory usage optimizations
|
||||
@ -24,25 +23,6 @@ const (
|
||||
readmePath = "./README.md"
|
||||
tplPath = "tmpl/tmpl.html"
|
||||
idxPath = "tmpl/index.html"
|
||||
|
||||
bfHTMLRendererOpts = 0 |
|
||||
blackfriday.HTML_USE_XHTML |
|
||||
blackfriday.HTML_USE_SMARTYPANTS |
|
||||
blackfriday.HTML_SMARTYPANTS_FRACTIONS |
|
||||
blackfriday.HTML_SMARTYPANTS_DASHES |
|
||||
blackfriday.HTML_SMARTYPANTS_LATEX_DASHES
|
||||
|
||||
bfMDOpts = 0 |
|
||||
blackfriday.EXTENSION_NO_INTRA_EMPHASIS |
|
||||
blackfriday.EXTENSION_TABLES |
|
||||
blackfriday.EXTENSION_FENCED_CODE |
|
||||
blackfriday.EXTENSION_AUTOLINK |
|
||||
blackfriday.EXTENSION_STRIKETHROUGH |
|
||||
blackfriday.EXTENSION_SPACE_HEADERS |
|
||||
blackfriday.EXTENSION_HEADER_IDS |
|
||||
blackfriday.EXTENSION_BACKSLASH_LINE_BREAK |
|
||||
blackfriday.EXTENSION_DEFINITION_LISTS |
|
||||
blackfriday.EXTENSION_AUTO_HEADER_IDS
|
||||
)
|
||||
|
||||
var (
|
||||
@ -59,19 +39,7 @@ func generateHTML() {
|
||||
exec.Command(git, pull).Output()
|
||||
|
||||
input, _ := ioutil.ReadFile(readmePath)
|
||||
body := string(
|
||||
bluemonday.UGCPolicy().SanitizeBytes(
|
||||
blackfriday.Markdown(
|
||||
input,
|
||||
blackfriday.HtmlRenderer(
|
||||
bfHTMLRendererOpts,
|
||||
emtyStr,
|
||||
emtyStr,
|
||||
),
|
||||
bfMDOpts,
|
||||
),
|
||||
),
|
||||
)
|
||||
body := string(gfm.Markdown(input))
|
||||
c := &content{Body: body}
|
||||
|
||||
t := template.Must(template.ParseFiles(tplPath))
|
||||
|
Loading…
Reference in New Issue
Block a user