Documentation
¶
Overview ¶
bham or the "blocky hypertext abstraction markup" is an attempt to take what is good about languages like haml, jade, slim, etc. and port it to Go, but not blindly. It will take into account the capabilities of Go's template libraries to parse directly into the internal template structures that the stdlib template libraries use to provide both speed and interoperability with standard Go templates.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Strict determines whether only tabs will be considered // as indentation operators (Strict == true) or whether // two spaces can be counted as an indentation operator // (Strict == false), this is included for haml // semi-comapibility Strict bool // To add multiple id declarations, the outputter puts them together // with a join string, by default this is an underscore IdJoin = "_" // Like the template library, you need to be able to set code delimeters LeftDelim = "{{" RightDelim = "}}" )
View Source
var Doctypes = map[string]string{
"": `<!DOCTYPE html>`,
"Transitional": `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">`,
"Strict": `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">`,
"Frameset": `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">`,
"5": `<!DOCTYPE html>`,
"1.1": `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">`,
"Basic": `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">`,
"Mobile": `<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">`,
"RDFa": `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">`,
}
View Source
var Filters = []FilterHandler{ FilterHandler{ Trigger: ":javascript", Open: `<script type="text/javascript">`, Close: "</script>", Handler: Transformer(func(s string) string { return s }), }, FilterHandler{ Trigger: ":css", Open: `<style>`, Close: "</style>", Handler: Transformer(func(s string) string { return s }), }, }
Functions ¶
Types ¶
type FilterHandler ¶
type FilterHandler struct { Trigger string Open, Close string Handler Transformer }
type Transformer ¶
Click to show internal directories.
Click to hide internal directories.