mirror of
https://github.com/avelino/awesome-go.git
synced 2024-11-07 16:33:40 +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
|
sudo: false
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- go get github.com/russross/blackfriday
|
- go get -t -v ./...
|
||||||
- go get github.com/PuerkitoBio/goquery
|
|
||||||
- go get github.com/gorilla/mux
|
|
||||||
- go get github.com/microcosm-cc/bluemonday
|
|
||||||
|
36
repo.go
36
repo.go
@ -8,8 +8,7 @@ import (
|
|||||||
"text/template"
|
"text/template"
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/microcosm-cc/bluemonday"
|
gfm "github.com/shurcooL/github_flavored_markdown"
|
||||||
"github.com/russross/blackfriday"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// memory usage optimizations
|
// memory usage optimizations
|
||||||
@ -24,25 +23,6 @@ const (
|
|||||||
readmePath = "./README.md"
|
readmePath = "./README.md"
|
||||||
tplPath = "tmpl/tmpl.html"
|
tplPath = "tmpl/tmpl.html"
|
||||||
idxPath = "tmpl/index.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 (
|
var (
|
||||||
@ -59,19 +39,7 @@ func generateHTML() {
|
|||||||
exec.Command(git, pull).Output()
|
exec.Command(git, pull).Output()
|
||||||
|
|
||||||
input, _ := ioutil.ReadFile(readmePath)
|
input, _ := ioutil.ReadFile(readmePath)
|
||||||
body := string(
|
body := string(gfm.Markdown(input))
|
||||||
bluemonday.UGCPolicy().SanitizeBytes(
|
|
||||||
blackfriday.Markdown(
|
|
||||||
input,
|
|
||||||
blackfriday.HtmlRenderer(
|
|
||||||
bfHTMLRendererOpts,
|
|
||||||
emtyStr,
|
|
||||||
emtyStr,
|
|
||||||
),
|
|
||||||
bfMDOpts,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
c := &content{Body: body}
|
c := &content{Body: body}
|
||||||
|
|
||||||
t := template.Must(template.ParseFiles(tplPath))
|
t := template.Must(template.ParseFiles(tplPath))
|
||||||
|
Loading…
Reference in New Issue
Block a user