Documentation ¶
Index ¶
- Constants
- Variables
- func EvalExpression(engine *Engine, expression string, context map[string]interface{}) (string, error)
- func ExtractFirstParagraph(htmlReader io.Reader) string
- func InjectScript(htmlReader io.Reader, jsCode string) (io.Reader, error)
- func Smartify(extension string, contentReader io.Reader) (io.Reader, error)
- type Engine
- type Minifier
- type Template
Constants ¶
View Source
const CODE_TABWIDTH = 4
View Source
const FM_SEPARATOR = "---"
View Source
const NO_SYNTAX_HIGHLIGHTING = ""
Variables ¶
View Source
var SKIP_TAGS = []string{"pre", "code", "kbd", "script", "math"}
View Source
var SUPPORTED_MINIFIERS = []string{".css", ".html", ".js", ".xml"}
Functions ¶
func EvalExpression ¶
func ExtractFirstParagraph ¶
Find the first p tag in the given html document and return its text content.
func InjectScript ¶
Inject a <script> tag with the given JavaScript code into provided the HTML document and return the updated document as a new io.Reader
Types ¶
type Minifier ¶
type Minifier struct {
// contains filtered or unexported fields
}
func LoadMinifier ¶
type Template ¶
type Template struct { SrcPath string Metadata map[string]interface{} // contains filtered or unexported fields }
func Parse ¶
Try to parse a liquid template at the given location. Files starting with front matter (--- sorrrounded yaml) are considered templates. If the given file is not headed by front matter return (nil, nil). The front matter contents are stored in the returned template's Metadata.
func (Template) RenderWith ¶
Renders the liquid template with the given context as bindings. If the template source is org or md, convert them to html after the liquid rendering.
Click to show internal directories.
Click to hide internal directories.