Add (a bad) comparison to goorgeous to github pages

The stylesheet would have to be adapted to get a fair visual comparison - but
this should be enough for comparing behavior
This commit is contained in:
Niklas Fasching 2018-12-17 14:52:29 +01:00
parent 0eb3baf1bb
commit 5afba92f5f
2 changed files with 79 additions and 20 deletions

34
etc/_goorgeous.go Normal file
View file

@ -0,0 +1,34 @@
package main
import (
"io/ioutil"
"log"
"os"
"github.com/chaseadamsio/goorgeous"
"github.com/russross/blackfriday"
)
func main() {
defer func() {
if err := recover(); err != nil {
log.Print(err)
}
}()
log.SetFlags(0)
log.SetOutput(os.Stdout)
path := os.Args[1]
in, err := ioutil.ReadFile(path)
if err != nil {
log.Fatal(err)
}
flags := blackfriday.HTML_USE_XHTML
flags |= blackfriday.LIST_ITEM_BEGINNING_OF_LIST
flags |= blackfriday.HTML_FOOTNOTE_RETURN_LINKS
parameters := blackfriday.HtmlRendererParameters{}
parameters.FootnoteReturnLinkContents = "<sup>↩</sup>"
renderer := blackfriday.HtmlRendererWithParameters(flags, "", "", parameters)
log.Print(string(goorgeous.Org(in, renderer)))
}