Documentation
¶
Index ¶
Constants ¶
const ( Ext = ".tex" ContentType = "text/x-tex; charset=utf-8" )
const DefaultTeX = `` /* 539-byte string literal not displayed */
The default tex template. It is valid LaTex (compiled with any latex, pdflatex, xelatex, lualatex, or other program). It is exported for documentation purposes (can be used as a basis for your more elaborate templates).
Variables ¶
var DefaultTemplate = must(New("_default.tex").Parse(DefaultTeX))
Functions ¶
func EscapeString ¶
Types ¶
type Template ¶
Template extends the standard text/template.Template to implement interface sql2http.Template (with ContentType method), sets the delimiters to `((` & `))`, and adds a new template function `tex` to escape strings in (La)TeX documents.
func New ¶
New wraps the standard library text/template.New. It is a simple helper function to avoid importing the standard library.
func ParseTree ¶
ParseTree creates a new Template, walks recursively the files starting at the given directory, and for each file ending with ".tex" parses the template definition under the relative file name. The returned template is the first matching file.
func (*Template) ContentType ¶
ContentType implements interface sql2http.Template. It returns the constant string ContentType.