Documentation ¶
Index ¶
- Constants
- Variables
- func Render(w io.Writer, n *Node) error
- func RenderBody(w io.Writer, page *Page, body *Node) error
- func RenderString(page *Page, body *Node) (string, error)
- func Template(p *Page, body *Node) (*template.Template, error)
- func TemplateBody(children ...interface{}) (*template.Template, error)
- type Attrs
- type Class
- type Node
- func Element(n interface{}, children ...interface{}) *Node
- func NewCSSLink(href string) *Node
- func NewHTML(lang string) *Node
- func NewHTMLChinese() *Node
- func NewHTMLEnglish() *Node
- func NewLink(href string, children ...interface{}) *Node
- func NewMeta(key, value string) *Node
- func Text(s string) *Node
- type Page
Constants ¶
View Source
const HTMLDocString = "<!doctype html>"
HTMLDocString is the doc type string for HTML.
Variables ¶
View Source
var ( HTML = bind(atom.Html) Head = bind(atom.Head) Title = bind(atom.Title) Meta = bind(atom.Meta) Link = bind(atom.Link) Body = bind(atom.Body) Div = bind(atom.Div) Span = bind(atom.Span) P = bind(atom.P) Pre = bind(atom.Pre) Blockquote = bind(atom.Blockquote) Strong = bind(atom.Strong) Em = bind(atom.Em) H1 = bind(atom.H1) H2 = bind(atom.H2) H3 = bind(atom.H3) H4 = bind(atom.H3) H5 = bind(atom.H3) H6 = bind(atom.H3) A = bind(atom.A) Ul = bind(atom.Ul) Ol = bind(atom.Ol) Li = bind(atom.Li) Br = bind(atom.Br) )
Shorthand element creators.
Functions ¶
func RenderBody ¶
RenderBody renders a page with the given Body
func RenderString ¶
RenderString renders a page into a string.
func TemplateBody ¶
TemplateBody makes an HTML template with the given elements as the body.
Types ¶
type Node ¶
Node wraps around an html node.
func Element ¶
func Element(n interface{}, children ...interface{}) *Node
Element create a new element.
func NewCSSLink ¶
NewCSSLink creates a new CSS link ini uh 6tg6fdb n bnnnnnnnnnnn<F6><F6>
func NewHTMLChinese ¶
func NewHTMLChinese() *Node
NewHTMLChinese creates a new Chinese HTML element.
func NewHTMLEnglish ¶
func NewHTMLEnglish() *Node
NewHTMLEnglish creates a new English HTML element.
Click to show internal directories.
Click to hide internal directories.