Skip to content

html #

fn block #

fn block(tag BlockTagConfig) Tag

block is the same as tag but with Tag children

fn br #

fn br() Tag

br returns a Tag equivalent to <br />

fn html #

fn html(children []Tag) Tag

html returns a Tag equivalent to <!DOCTYPE html><html>...</html>

fn meta #

fn meta(attr map[string]string) Tag

meta returns a Tag equivalent to <meta />

fn style #

fn style(style string) Tag

style returns a Tag equivalent to <style>...</style>

fn tag #

fn tag(tag Tag) Tag

tag returns itself for uniformity when using function-based DSL

struct BlockTagConfig #

struct BlockTagConfig {
	name     string
	attr     map[string]string
	children []Tag
}

struct Tag #

struct Tag {
mut:
	name     string
	attr     map[string]string
	children []Tag
	text     string
	empty    bool
}

fn (Tag) str #

fn (tag Tag) str() string

return the tag to encoded JSON

fn (Tag) is_text #

fn (tag Tag) is_text() bool

is_text returns true if the tag name is empty and if the tag text is not empty.

fn (Tag) html #

fn (tag Tag) html() string

html returns the HTML output of the contents of the Tag struct.