mdtohtml: add head flag
This commit is contained in:
parent
3e417d7788
commit
3820aa5604
1 changed files with 26 additions and 1 deletions
|
@ -1,6 +1,23 @@
|
||||||
--- a/main.go
|
--- a/main.go
|
||||||
+++ b/main.go
|
+++ b/main.go
|
||||||
@@ -100,7 +100,8 @@
|
@@ -17,7 +17,7 @@
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
var page, toc, xhtml, latex, smartypants, latexdashes, fractions bool
|
||||||
|
- var css, cpuprofile string
|
||||||
|
+ var css, cpuprofile, head string
|
||||||
|
var repeat int
|
||||||
|
flag.BoolVar(&page, "page", false,
|
||||||
|
"Generate a standalone HTML page (implies -latex=false)")
|
||||||
|
@@ -39,6 +39,7 @@
|
||||||
|
"Write cpu profile to a file")
|
||||||
|
flag.IntVar(&repeat, "repeat", 1,
|
||||||
|
"Process the input multiple times (for benchmarking)")
|
||||||
|
+ flag.StringVar(&head, "head", "", "Add extra stuff to header")
|
||||||
|
flag.Usage = func() {
|
||||||
|
fmt.Fprintf(os.Stderr, "Markdown Processor "+
|
||||||
|
"\nAvailable at http://github.com/gomarkdown/markdown/cmd/mdtohtml\n\n"+
|
||||||
|
@@ -100,7 +101,8 @@
|
||||||
parser.FencedCode |
|
parser.FencedCode |
|
||||||
parser.Autolink |
|
parser.Autolink |
|
||||||
parser.Strikethrough |
|
parser.Strikethrough |
|
||||||
|
@ -10,3 +27,11 @@
|
||||||
|
|
||||||
var renderer markdown.Renderer
|
var renderer markdown.Renderer
|
||||||
if latex {
|
if latex {
|
||||||
|
@@ -133,6 +135,7 @@
|
||||||
|
Flags: htmlFlags,
|
||||||
|
Title: title,
|
||||||
|
CSS: css,
|
||||||
|
+ Head: []byte(head),
|
||||||
|
}
|
||||||
|
renderer = html.NewRenderer(params)
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue