elems

package
v1.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2022 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Urls for normal build

Index

Constants

View Source
const (
	ID_MAIN_CONTENT           = "gohtml-main-content"
	CLASS_NAVBAR              = "gohtml-navbar"
	CLASS_NAVBAR_LEFT         = "gohtml-left"
	CLASS_NAVBAR_RIGHT        = "gohtml-right"
	CLASS_NAVIGATION_LINK     = "gohtml-navigation-link"
	ID_SIDE_OPEN_BTN          = "gohtml-openbtn"
	ID_SIDE_CLOSE_BTN         = "gohtml-closebtn"
	ID_SIDE_NAVBAR            = "gohtml-sidenav"
	CLASS_SIDE_NAVBAR         = "gohtml-sidenav"
	CLASS_SIDE_NAVBAR_FOOTER  = "gohtml-footer"
	CLASS_SIDE_NAVBAR_CONTENT = "gohtml-content-nav"
	CLASS_ACTIVE              = "gohtml-active"
)
View Source
const DefaultNavStyle = `` /* 523-byte string literal not displayed */
View Source
const DefaultSideNavStyle = `` /* 965-byte string literal not displayed */
View Source
const SPACING string = "    "

Variables

View Source
var NavBar = func(logo *Logo, urls URLs) (*Element, Elements) {
	nav := Elem("div")
	nav.Class(CLASS_NAVBAR)
	left := Elem("div")
	right := Elem("div")
	left.Class(CLASS_NAVBAR_LEFT)
	right.Class(CLASS_NAVBAR_RIGHT)

	var elems Elements
	// Selectors
	//.Class("gohtml-navbar")
	//.Class("gohtml-left")
	//.Class("gohtml-right")
	//.Class("gohtml-navigation-link")
	var logoElem *Element
	if logo != nil {
		logoElem = Elem("a").Class(CLASS_NAVIGATION_LINK).Href(logo.URL.URL)
		if logo.Image != "" {
			logoElem.Add(Img().Src(logo.Image))
		}
		elems = append(elems, logoElem)
		if logo.LeftOrRight {
			left.Add(logoElem.Style("float:left !important"))
		} else {
			right.Add(logoElem.Style("float:right !important"))
		}
	}

	for _, url := range urls {
		var urlElem *Element = Elem("a").Class(CLASS_NAVIGATION_LINK).InnerText(" " + url.Name).Href(url.URL)
		if url.Icon != "" {
			urlElem.Add(I().Class(url.Icon).Style("margin-left:5px;"))
		}
		elems = append(elems, urlElem)
		if url.LeftOrRight {
			left.Add(urlElem.Style("float:left !important"))
		} else {
			right.Add(urlElem.Style("float:right !important"))
		}
	}

	nav.Add(left, right)
	return nav, elems
}
View Source
var SideNavBar = func(logo *Logo, urls URLs, footer_urls ...URL) (*Element, *Element, Elements) {
	var urlElems = make(Elements, len(urls))
	for i, url := range urls {
		var urlElem = A(" " + url.Name).Href(url.URL).Class(CLASS_NAVIGATION_LINK)
		if url.Icon != "" {
			urlElem.Add(I().Class(url.Icon)).TextAfter()
		}
		urlElems[i] = urlElem
	}
	var footerElems = make(Elements, len(footer_urls))
	for i, url := range footer_urls {
		var urlElem = A(" " + url.Name).Href(url.URL).Class(CLASS_NAVIGATION_LINK)
		if url.Icon != "" {
			urlElem.Add(I().Class(url.Icon)).TextAfter()
		}
		footerElems[i] = urlElem
	}

	var body = Elem("div")

	body.Add(
		StyleBlock(DefaultSideNavStyle),
	)

	var navbar_btn = Span("☰").Style("font-size:30px").ID(ID_SIDE_OPEN_BTN).Onclick("document.getElementById(`gohtml-sidenav`).style.width = `250px`;document.getElementById(`gohtml-main-content`).style.marginLeft = `250px`;")
	var sidenav = Elem("div").ID(ID_SIDE_NAVBAR).Class(CLASS_SIDE_NAVBAR)
	var inner_footer = Elem("div").Class(CLASS_SIDE_NAVBAR_FOOTER)
	var content_div = Elem("div").ID(ID_MAIN_CONTENT)

	inner_footer.Add(footerElems...)

	var sideNavCloseBtnDiv = Div().Style("width: 100%")
	var logoElem *Element
	if logo != nil {
		logoElem = A().Href(logo.URL.URL).Style("width: 70%", "height: auto", "margin-left:15px")
		if logo.Image != "" {
			logoElem.Add(Img().Style("width: 70%", "height: auto").Src(logo.Image))
		}
		sideNavCloseBtnDiv.Add(logoElem)
	}

	var allURLS = make(Elements, len(urlElems)+len(footerElems))
	var n = copy(allURLS, urlElems)
	copy(allURLS[n:], footerElems)
	if logo != nil {
		allURLS = append(allURLS, logoElem)
	}

	sidenav.Add(
		sideNavCloseBtnDiv.Add(
			A("×").Href("javascript:void(0)").ID(ID_SIDE_CLOSE_BTN).Style("float:right").Onclick("document.getElementById(`gohtml-sidenav`).style.width = `0`;document.getElementById(`gohtml-main-content`).style.marginLeft= `0`;")),
	)

	sidenav.Add(Div().Class(CLASS_SIDE_NAVBAR_CONTENT).Add(append(urlElems, inner_footer)...))

	body.Add(navbar_btn, sidenav, content_div)

	return body, content_div, allURLS
}

Returns the navbar body to append to your HTML, the main-content area and all URLS

Functions

func FormDataToStruct added in v1.1.8

func FormDataToStruct(data map[string]string, s any)

func FormatIfDateTime added in v1.1.8

func FormatIfDateTime(val any) any

func GetValue added in v1.1.8

func GetValue(s any, column string) any

Get a value from a model struct

func InputWithLabel added in v1.1.8

func InputWithLabel(t ...string) (*Element, *Element, *Element)

func ReflectModelName added in v1.1.8

func ReflectModelName(s any) string

func SetValue added in v1.1.8

func SetValue(s any, column string, value any)

Set a value on a model struct

func TransformValue added in v1.1.8

func TransformValue(s any, field string, val any) (any, error)

Types

type Buffer

type Buffer interface {
	WriteString(string) (int, error)
	String() string
	Reset()
	Len() int
	Write(p []byte) (int, error)
}

func ParseToTemplate

func ParseToTemplate(buffer Buffer, templateData any) Buffer

type Element

type Element struct {
	Type string
	// contains filtered or unexported fields
}

func A

func A(t ...string) *Element

func Abbr

func Abbr(t ...string) *Element

func Address

func Address(t ...string) *Element

func Area

func Area(t ...string) *Element

func Article

func Article(t ...string) *Element

func Aside

func Aside(t ...string) *Element

func Audio

func Audio(t ...string) *Element

func B

func B(t ...string) *Element

func Bdi

func Bdi(t ...string) *Element

func Bdo

func Bdo(t ...string) *Element

func Blockquote

func Blockquote(t ...string) *Element

func Body

func Body(t ...string) *Element

func Br

func Br(t ...string) *Element

func Button

func Button(t ...string) *Element

func Canvas

func Canvas(t ...string) *Element

func Caption

func Caption(t ...string) *Element

func Cite

func Cite(t ...string) *Element

func Code

func Code(t ...string) *Element

func Col

func Col(t ...string) *Element

func Colgroup

func Colgroup(t ...string) *Element

func Command

func Command(t ...string) *Element

func Datalist

func Datalist(t ...string) *Element

func Dd

func Dd(t ...string) *Element

func Del

func Del(t ...string) *Element

func Details

func Details(t ...string) *Element

func Dfn

func Dfn(t ...string) *Element

func Div

func Div(t ...string) *Element

func Dl

func Dl(t ...string) *Element

func Dt

func Dt(t ...string) *Element

func Elem

func Elem(t string, inner ...string) *Element

func Em

func Em(t ...string) *Element

func Embed

func Embed(t ...string) *Element

func Fieldset

func Fieldset(t ...string) *Element

func Figcaption

func Figcaption(t ...string) *Element

func Figure

func Figure(t ...string) *Element
func Footer(t ...string) *Element

func Form

func Form(t ...string) *Element

func H1

func H1(t ...string) *Element

func H2

func H2(t ...string) *Element

func H3

func H3(t ...string) *Element

func H4

func H4(t ...string) *Element

func H5

func H5(t ...string) *Element

func H6

func H6(t ...string) *Element
func Header(t ...string) *Element

func Hr

func Hr(t ...string) *Element

func I

func I(t ...string) *Element

func Iframe

func Iframe(t ...string) *Element

func Img

func Img(t ...string) *Element

func Input

func Input(t ...string) *Element

func Ins

func Ins(t ...string) *Element

func Kbd

func Kbd(t ...string) *Element

func Keygen

func Keygen(t ...string) *Element

func Label

func Label(t ...string) *Element

func Legend

func Legend(t ...string) *Element

func Li

func Li(t ...string) *Element

func Main

func Main(t ...string) *Element

func Map

func Map(t ...string) *Element

func Mark

func Mark(t ...string) *Element
func Menu(t ...string) *Element

func Meter

func Meter(t ...string) *Element
func Nav(t ...string) *Element

func Object

func Object(t ...string) *Element

func Ol

func Ol(t ...string) *Element

func Optgroup

func Optgroup(t ...string) *Element

func Option

func Option(t ...string) *Element

func Output

func Output(t ...string) *Element

func P

func P(t ...string) *Element

func Param

func Param(t ...string) *Element

func Pre

func Pre(t ...string) *Element

func Progress

func Progress(t ...string) *Element

func Q

func Q(t ...string) *Element

func Rp

func Rp(t ...string) *Element

func Rt

func Rt(t ...string) *Element

func Ruby

func Ruby(t ...string) *Element

func S

func S(t ...string) *Element

func Samp

func Samp(t ...string) *Element

func Script

func Script(src string, typ ...string) *Element

func ScriptInline

func ScriptInline(sourceCode string, typ ...string) *Element

func Section

func Section(t ...string) *Element

func Select

func Select(t ...string) *Element

func Small

func Small(t ...string) *Element

func Source

func Source(t ...string) *Element

func Span

func Span(t ...string) *Element

func Strong

func Strong(t ...string) *Element

func StructToForm added in v1.1.8

func StructToForm(s any, inputClass string) *Element

func StyleBlock

func StyleBlock(t ...string) *Element

func StyleSheet

func StyleSheet(href string, rel string) *Element

func Sub

func Sub(t ...string) *Element

func Summary

func Summary(t ...string) *Element

func Sup

func Sup(t ...string) *Element

func Table

func Table(t ...string) *Element

func Tbody

func Tbody(t ...string) *Element

func Td

func Td(t ...string) *Element

func Textarea

func Textarea(t ...string) *Element

func Tfoot

func Tfoot(t ...string) *Element

func Th

func Th(t ...string) *Element

func Thead

func Thead(t ...string) *Element

func Time

func Time(t ...string) *Element

func Tr

func Tr(t ...string) *Element

func Track

func Track(t ...string) *Element

func U

func U(t ...string) *Element

func Ul

func Ul(t ...string) *Element

func Var

func Var(t ...string) *Element

func Video

func Video(t ...string) *Element

func Wbr

func Wbr(t ...string) *Element

func (*Element) A

func (e *Element) A(t ...string) *Element

func (*Element) A_Accept

func (e *Element) A_Accept(attr_accept ...string) *Element

Accept is the attr_accept attribute. (Autogenerated)

func (*Element) A_Accesskey

func (e *Element) A_Accesskey(attr_accesskey ...string) *Element

Accesskey is the attr_accesskey attribute. (Autogenerated)

func (*Element) A_Align

func (e *Element) A_Align(attr_align ...string) *Element

Align is the attr_align attribute. (Autogenerated)

func (*Element) A_Async

func (e *Element) A_Async() *Element

Async is the attr_async attribute. (Autogenerated)

func (*Element) A_Autocomplete

func (e *Element) A_Autocomplete(def bool) *Element

Autocomplete is the attr_autocomplete attribute. (Autogenerated)

func (*Element) A_Autofocus

func (e *Element) A_Autofocus() *Element

Autofocus is the attr_autofocus attribute. (Autogenerated)

func (*Element) A_Autoplay

func (e *Element) A_Autoplay() *Element

Autoplay is the attr_autoplay attribute. (Autogenerated)

func (*Element) A_Cite

func (e *Element) A_Cite(attr_cite ...string) *Element

Cite is the attr_cite attribute. (Autogenerated)

func (*Element) A_Cols

func (e *Element) A_Cols(attr_cols string) *Element

Cols is the attr_cols attribute. (Autogenerated)

func (*Element) A_Colspan

func (e *Element) A_Colspan(attr_colspan string) *Element

Colspan is the attr_colspan attribute. (Autogenerated)

func (*Element) A_Content

func (e *Element) A_Content(attr_content ...string) *Element

Content is the attr_content attribute. (Autogenerated)

func (*Element) A_Contenteditable

func (e *Element) A_Contenteditable() *Element

Contenteditable is the attr_contenteditable attribute. (Autogenerated)

func (*Element) A_Contextmenu

func (e *Element) A_Contextmenu(attr_contextmenu ...string) *Element

Contextmenu is the attr_contextmenu attribute. (Autogenerated)

func (*Element) A_Controls

func (e *Element) A_Controls(attr_controls ...string) *Element

Controls is the attr_controls attribute. (Autogenerated)

func (*Element) A_Coords

func (e *Element) A_Coords(attr_coords ...string) *Element

Coords is the attr_coords attribute. (Autogenerated)

func (*Element) A_Data

func (e *Element) A_Data(attr_data ...string) *Element

Data is the attr_data attribute. (Autogenerated)

func (*Element) A_Datetime

func (e *Element) A_Datetime(attr_datetime ...string) *Element

Datetime is the attr_datetime attribute. (Autogenerated)

func (*Element) A_Default

func (e *Element) A_Default(attr_default ...string) *Element

Default is the attr_default attribute. (Autogenerated)

func (*Element) A_Defer

func (e *Element) A_Defer() *Element

Defer is the attr_defer attribute. (Autogenerated)

func (*Element) A_Dir

func (e *Element) A_Dir(attr_dir ...string) *Element

Dir is the attr_dir attribute. (Autogenerated)

func (*Element) A_Dirname

func (e *Element) A_Dirname(attr_dirname ...string) *Element

Dirname is the attr_dirname attribute. (Autogenerated)

func (*Element) A_Disabled

func (e *Element) A_Disabled() *Element

Disabled is the attr_disabled attribute. (Autogenerated)

func (*Element) A_Download

func (e *Element) A_Download(attr_download ...string) *Element

Download is the attr_download attribute. (Autogenerated)

func (*Element) A_Draggable

func (e *Element) A_Draggable() *Element

Draggable is the attr_draggable attribute. (Autogenerated)

func (*Element) A_Dropzone

func (e *Element) A_Dropzone(attr_dropzone ...string) *Element

Dropzone is the attr_dropzone attribute. (Autogenerated)

func (*Element) A_Enctype

func (e *Element) A_Enctype(attr_enctype ...string) *Element

Enctype is the attr_enctype attribute. (Autogenerated)

func (*Element) A_For

func (e *Element) A_For(attr_for ...string) *Element

For is the attr_for attribute. (Autogenerated)

func (*Element) A_Form

func (e *Element) A_Form(attr_form ...string) *Element

Form is the attr_form attribute. (Autogenerated)

func (*Element) A_Formaction

func (e *Element) A_Formaction(attr_formaction ...string) *Element

Formaction is the attr_formaction attribute. (Autogenerated)

func (*Element) A_Headers

func (e *Element) A_Headers(attr_headers ...string) *Element

Headers is the attr_headers attribute. (Autogenerated)

func (*Element) A_High

func (e *Element) A_High(attr_high ...string) *Element

High is the attr_high attribute. (Autogenerated)

func (*Element) A_Hreflang

func (e *Element) A_Hreflang(attr_hreflang ...string) *Element

Hreflang is the attr_hreflang attribute. (Autogenerated)

func (*Element) A_Http

func (e *Element) A_Http(attr_http ...string) *Element

Http is the attr_http attribute. (Autogenerated)

func (*Element) A_Ismap

func (e *Element) A_Ismap(attr_ismap ...string) *Element

Ismap is the attr_ismap attribute. (Autogenerated)

func (*Element) A_Kind

func (e *Element) A_Kind(attr_kind ...string) *Element

Kind is the attr_kind attribute. (Autogenerated)

func (*Element) A_Label

func (e *Element) A_Label(attr_label ...string) *Element

Label is the attr_label attribute. (Autogenerated)

func (*Element) A_Lang

func (e *Element) A_Lang(attr_lang ...string) *Element

Lang is the attr_lang attribute. (Autogenerated)

func (*Element) A_List

func (e *Element) A_List(attr_list ...string) *Element

List is the attr_list attribute. (Autogenerated)

func (*Element) A_Loop

func (e *Element) A_Loop(attr_loop ...string) *Element

Loop is the attr_loop attribute. (Autogenerated)

func (*Element) A_Low

func (e *Element) A_Low(attr_low ...string) *Element

Low is the attr_low attribute. (Autogenerated)

func (*Element) A_Max

func (e *Element) A_Max(attr_max ...string) *Element

Max is the attr_max attribute. (Autogenerated)

func (*Element) A_Maxlength

func (e *Element) A_Maxlength(attr_maxlength ...string) *Element

Maxlength is the attr_maxlength attribute. (Autogenerated)

func (*Element) A_Media

func (e *Element) A_Media(attr_media ...string) *Element

Media is the attr_media attribute. (Autogenerated)

func (*Element) A_Min

func (e *Element) A_Min(attr_min ...string) *Element

Min is the attr_min attribute. (Autogenerated)

func (*Element) A_Multiple

func (e *Element) A_Multiple(attr_multiple ...string) *Element

Multiple is the attr_multiple attribute. (Autogenerated)

func (*Element) A_Muted

func (e *Element) A_Muted() *Element

Muted is the attr_muted attribute. (Autogenerated)

func (*Element) A_Novalidate

func (e *Element) A_Novalidate() *Element

Novalidate is the attr_novalidate attribute. (Autogenerated)

func (*Element) A_Open

func (e *Element) A_Open(attr_open ...string) *Element

Open is the attr_open attribute. (Autogenerated)

func (*Element) A_Optimum

func (e *Element) A_Optimum(attr_optimum ...string) *Element

Optimum is the attr_optimum attribute. (Autogenerated)

func (*Element) A_Pattern

func (e *Element) A_Pattern(attr_pattern ...string) *Element

Pattern is the attr_pattern attribute. (Autogenerated)

func (*Element) A_Placeholder

func (e *Element) A_Placeholder(attr_placeholder ...string) *Element

Placeholder is the attr_placeholder attribute. (Autogenerated)

func (*Element) A_Poster

func (e *Element) A_Poster(attr_poster ...string) *Element

Poster is the attr_poster attribute. (Autogenerated)

func (*Element) A_Preload

func (e *Element) A_Preload(attr_preload bool) *Element

Preload is the attr_preload attribute. (Autogenerated)

func (*Element) A_Readonly

func (e *Element) A_Readonly() *Element

Readonly is the attr_readonly attribute. (Autogenerated)

func (*Element) A_Rel

func (e *Element) A_Rel(attr_rel string) *Element

Rel is the attr_rel attribute. (Autogenerated)

func (*Element) A_Required

func (e *Element) A_Required() *Element

Required is the attr_required attribute. (Autogenerated)

func (*Element) A_Reversed

func (e *Element) A_Reversed() *Element

Reversed is the attr_reversed attribute. (Autogenerated)

func (*Element) A_Rows

func (e *Element) A_Rows(attr_rows string) *Element

Rows is the attr_rows attribute. (Autogenerated)

func (*Element) A_Rowspan

func (e *Element) A_Rowspan(attr_rowspan string) *Element

Rowspan is the attr_rowspan attribute. (Autogenerated)

func (*Element) A_Sandbox

func (e *Element) A_Sandbox(attr_sandbox ...string) *Element

Sandbox is the attr_sandbox attribute. (Autogenerated)

func (*Element) A_Scope

func (e *Element) A_Scope(attr_scope ...string) *Element

Scope is the attr_scope attribute. (Autogenerated)

func (*Element) A_Selected

func (e *Element) A_Selected() *Element

Selected is the attr_selected attribute. (Autogenerated)

func (*Element) A_Shape

func (e *Element) A_Shape(attr_shape ...string) *Element

Shape is the attr_shape attribute. (Autogenerated)

func (*Element) A_Size

func (e *Element) A_Size(attr_size ...string) *Element

Size is the attr_size attribute. (Autogenerated)

func (*Element) A_Sizes

func (e *Element) A_Sizes(attr_sizes ...string) *Element

Sizes is the attr_sizes attribute. (Autogenerated)

func (*Element) A_Span

func (e *Element) A_Span(attr_span ...string) *Element

Span is the attr_span attribute. (Autogenerated)

func (*Element) A_Spellcheck

func (e *Element) A_Spellcheck(attr_spellcheck bool) *Element

Spellcheck is the attr_spellcheck attribute. (Autogenerated)

func (*Element) A_Srcdoc

func (e *Element) A_Srcdoc(attr_srcdoc ...string) *Element

Srcdoc is the attr_srcdoc attribute. (Autogenerated)

func (*Element) A_Srclang

func (e *Element) A_Srclang(attr_srclang ...string) *Element

Srclang is the attr_srclang attribute. (Autogenerated)

func (*Element) A_Srcset

func (e *Element) A_Srcset(attr_srcset ...string) *Element

Srcset is the attr_srcset attribute. (Autogenerated)

func (*Element) A_Start

func (e *Element) A_Start(attr_start ...string) *Element

Start is the attr_start attribute. (Autogenerated)

func (*Element) A_Step

func (e *Element) A_Step(attr_step ...string) *Element

Step is the attr_step attribute. (Autogenerated)

func (*Element) A_Tabindex

func (e *Element) A_Tabindex(attr_tabindex ...string) *Element

Tabindex is the attr_tabindex attribute. (Autogenerated)

func (*Element) A_Target

func (e *Element) A_Target(attr_target ...string) *Element

Target is the attr_target attribute. (Autogenerated)

func (*Element) A_Title

func (e *Element) A_Title(attr_title string) *Element

Title is the attr_title attribute. (Autogenerated)

func (*Element) A_Translate

func (e *Element) A_Translate(attr_translate bool) *Element

Translate is the attr_translate attribute. (Autogenerated)

func (*Element) A_Type

func (e *Element) A_Type(attr_type string) *Element

Type is the attr_type attribute. (Autogenerated)

func (*Element) A_Usemap

func (e *Element) A_Usemap(attr_usemap ...string) *Element

Usemap is the attr_usemap attribute. (Autogenerated)

func (*Element) A_Value

func (e *Element) A_Value(attr_value string) *Element

Value is the attr_value attribute. (Autogenerated)

func (*Element) A_Wrap

func (e *Element) A_Wrap(attr_wrap ...string) *Element

Wrap is the attr_wrap attribute. (Autogenerated)

func (*Element) Abbr

func (e *Element) Abbr(t ...string) *Element

func (*Element) Action

func (e *Element) Action(attr_action ...string) *Element

Action is the attr_action attribute. (Autogenerated)

func (*Element) Add

func (e *Element) Add(elems ...*Element) *Element

func (*Element) Address

func (e *Element) Address(t ...string) *Element

func (*Element) All

func (e *Element) All() Elements

func (*Element) Alt

func (e *Element) Alt(attr_alt string) *Element

Alt is the attr_alt attribute. (Autogenerated)

func (*Element) AppendChild

func (e *Element) AppendChild(child *Element)

func (*Element) Area

func (e *Element) Area(t ...string) *Element

func (*Element) Article

func (e *Element) Article(t ...string) *Element

func (*Element) Aside

func (e *Element) Aside(t ...string) *Element

func (*Element) Audio

func (e *Element) Audio(t ...string) *Element

func (*Element) B

func (e *Element) B(t ...string) *Element

func (*Element) BackgroundColor

func (e *Element) BackgroundColor(color string) *Element

func (*Element) Bdi

func (e *Element) Bdi(t ...string) *Element

func (*Element) Bdo

func (e *Element) Bdo(t ...string) *Element

func (*Element) Bgcolor

func (e *Element) Bgcolor(attr_bgcolor string) *Element

Bgcolor is the attr_bgcolor attribute. (Autogenerated)

func (*Element) Blockquote

func (e *Element) Blockquote(t ...string) *Element

func (*Element) Body

func (e *Element) Body(t ...string) *Element

func (*Element) Border

func (e *Element) Border(attr_border ...string) *Element

Border is the attr_border attribute. (Autogenerated)

func (*Element) Br

func (e *Element) Br(t ...string) *Element

func (*Element) Button

func (e *Element) Button(t ...string) *Element

func (*Element) Canvas

func (e *Element) Canvas(t ...string) *Element

func (*Element) Caption

func (e *Element) Caption(t ...string) *Element

func (*Element) Charset

func (e *Element) Charset(attr_charset ...string) *Element

Charset is the attr_charset attribute. (Autogenerated)

func (*Element) Checked

func (e *Element) Checked() *Element

Checked is the attr_checked attribute. (Autogenerated)

func (*Element) Children

func (e *Element) Children() Elements

func (*Element) Cite

func (e *Element) Cite(t ...string) *Element

func (*Element) Class

func (e *Element) Class(classes ...string) *Element

func (*Element) Code

func (e *Element) Code(t ...string) *Element

func (*Element) Col

func (e *Element) Col(t ...string) *Element

func (*Element) Colgroup

func (e *Element) Colgroup(t ...string) *Element

func (*Element) Color

func (e *Element) Color(attr_color string) *Element

Color is the attr_color attribute. (Autogenerated)

func (*Element) Command

func (e *Element) Command(t ...string) *Element

func (*Element) Custom

func (e *Element) Custom(key string, values ...string) *Element

func (*Element) Datalist

func (e *Element) Datalist(t ...string) *Element

func (*Element) Dd

func (e *Element) Dd(t ...string) *Element

func (*Element) Del

func (e *Element) Del(t ...string) *Element

func (*Element) DelAttr added in v1.2.4

func (e *Element) DelAttr(name string) *Element

func (*Element) DeleteInnerElementByID added in v1.2.4

func (e *Element) DeleteInnerElementByID(id string)

func (*Element) Details

func (e *Element) Details(t ...string) *Element

func (*Element) Dfn

func (e *Element) Dfn(t ...string) *Element

func (*Element) Div

func (e *Element) Div(t ...string) *Element

func (*Element) Dl

func (e *Element) Dl(t ...string) *Element

func (*Element) Dt

func (e *Element) Dt(t ...string) *Element

func (*Element) Em

func (e *Element) Em(t ...string) *Element

func (*Element) Embed

func (e *Element) Embed(t ...string) *Element

func (*Element) Fieldset

func (e *Element) Fieldset(t ...string) *Element

func (*Element) Figcaption

func (e *Element) Figcaption(t ...string) *Element

func (*Element) Figure

func (e *Element) Figure(t ...string) *Element

func (*Element) Footer

func (e *Element) Footer(t ...string) *Element

func (*Element) ForEach

func (e *Element) ForEach(fn func(*Element))

func (*Element) Form

func (e *Element) Form(t ...string) *Element

func (*Element) Generate

func (e *Element) Generate(spacing string, buf Buffer)

func (*Element) GetByClassname

func (e *Element) GetByClassname(className string) Elements

func (*Element) GetByID

func (e *Element) GetByID(id string) *Element

func (*Element) GetClasses

func (e *Element) GetClasses() []string

func (*Element) GetID

func (e *Element) GetID() string

func (*Element) GetText

func (e *Element) GetText() string

func (*Element) H1

func (e *Element) H1(t ...string) *Element

func (*Element) H2

func (e *Element) H2(t ...string) *Element

func (*Element) H3

func (e *Element) H3(t ...string) *Element

func (*Element) H4

func (e *Element) H4(t ...string) *Element

func (*Element) H5

func (e *Element) H5(t ...string) *Element

func (*Element) H6

func (e *Element) H6(t ...string) *Element

func (*Element) HTML

func (e *Element) HTML(templateData any, buffer ...Buffer) string

Render to template.

func (*Element) Header

func (e *Element) Header(t ...string) *Element

func (*Element) Height

func (e *Element) Height(attr_height string) *Element

Height is the attr_height attribute. (Autogenerated)

func (*Element) Hidden

func (e *Element) Hidden() *Element

Hidden is the attr_hidden attribute. (Autogenerated)

func (*Element) Hr

func (e *Element) Hr(t ...string) *Element

func (*Element) Href

func (e *Element) Href(href string) *Element

func (*Element) I

func (e *Element) I(t ...string) *Element

func (*Element) ID

func (e *Element) ID(id string) *Element

func (*Element) Iframe

func (e *Element) Iframe(t ...string) *Element

func (*Element) Img

func (e *Element) Img(t ...string) *Element

func (*Element) InnerText

func (e *Element) InnerText(text string) *Element

func (*Element) Input

func (e *Element) Input(t ...string) *Element

func (*Element) InputWithLabel added in v1.1.8

func (e *Element) InputWithLabel(t ...string) (*Element, *Element, *Element)

func (*Element) Ins

func (e *Element) Ins(t ...string) *Element

func (*Element) Kbd

func (e *Element) Kbd(t ...string) *Element

func (*Element) Keygen

func (e *Element) Keygen(t ...string) *Element

func (*Element) Label

func (e *Element) Label(t ...string) *Element

func (*Element) Legend

func (e *Element) Legend(t ...string) *Element

func (*Element) Li

func (e *Element) Li(t ...string) *Element

func (*Element) Main

func (e *Element) Main(t ...string) *Element

func (*Element) Map

func (e *Element) Map(t ...string) *Element

func (*Element) Mark

func (e *Element) Mark(t ...string) *Element

func (*Element) Menu

func (e *Element) Menu(t ...string) *Element

func (*Element) Meter

func (e *Element) Meter(t ...string) *Element

func (*Element) Method

func (e *Element) Method(attr_method ...string) *Element

Method is the attr_method attribute. (Autogenerated)

func (*Element) Name

func (e *Element) Name(attr_name string) *Element

Name is the attr_name attribute. (Autogenerated)

func (*Element) Nav

func (e *Element) Nav(t ...string) *Element

func (*Element) NoClose

func (e *Element) NoClose() *Element

func (*Element) Object

func (e *Element) Object(t ...string) *Element

func (*Element) Ol

func (e *Element) Ol(t ...string) *Element

func (*Element) Onabort

func (e *Element) Onabort(attr_onabort ...string) *Element

Onabort is the attr_onabort attribute. (Autogenerated)

func (*Element) Onafterprint

func (e *Element) Onafterprint(attr_onafterprint ...string) *Element

Onafterprint is the attr_onafterprint attribute. (Autogenerated)

func (*Element) Onbeforeprint

func (e *Element) Onbeforeprint(attr_onbeforeprint ...string) *Element

Onbeforeprint is the attr_onbeforeprint attribute. (Autogenerated)

func (*Element) Onbeforeunload

func (e *Element) Onbeforeunload(attr_onbeforeunload ...string) *Element

Onbeforeunload is the attr_onbeforeunload attribute. (Autogenerated)

func (*Element) Onblur

func (e *Element) Onblur(attr_onblur ...string) *Element

Onblur is the attr_onblur attribute. (Autogenerated)

func (*Element) Oncanplay

func (e *Element) Oncanplay(attr_oncanplay ...string) *Element

Oncanplay is the attr_oncanplay attribute. (Autogenerated)

func (*Element) Oncanplaythrough

func (e *Element) Oncanplaythrough(attr_oncanplaythrough ...string) *Element

Oncanplaythrough is the attr_oncanplaythrough attribute. (Autogenerated)

func (*Element) Onchange

func (e *Element) Onchange(attr_onchange ...string) *Element

Onchange is the attr_onchange attribute. (Autogenerated)

func (*Element) Onclick

func (e *Element) Onclick(attr_onclick ...string) *Element

Onclick is the attr_onclick attribute. (Autogenerated)

func (*Element) Oncontextmenu

func (e *Element) Oncontextmenu(attr_oncontextmenu ...string) *Element

Oncontextmenu is the attr_oncontextmenu attribute. (Autogenerated)

func (*Element) Oncopy

func (e *Element) Oncopy(attr_oncopy ...string) *Element

Oncopy is the attr_oncopy attribute. (Autogenerated)

func (*Element) Oncuechange

func (e *Element) Oncuechange(attr_oncuechange ...string) *Element

Oncuechange is the attr_oncuechange attribute. (Autogenerated)

func (*Element) Oncut

func (e *Element) Oncut(attr_oncut ...string) *Element

Oncut is the attr_oncut attribute. (Autogenerated)

func (*Element) Ondblclick

func (e *Element) Ondblclick(attr_ondblclick ...string) *Element

Ondblclick is the attr_ondblclick attribute. (Autogenerated)

func (*Element) Ondrag

func (e *Element) Ondrag(attr_ondrag ...string) *Element

Ondrag is the attr_ondrag attribute. (Autogenerated)

func (*Element) Ondragend

func (e *Element) Ondragend(attr_ondragend ...string) *Element

Ondragend is the attr_ondragend attribute. (Autogenerated)

func (*Element) Ondragenter

func (e *Element) Ondragenter(attr_ondragenter ...string) *Element

Ondragenter is the attr_ondragenter attribute. (Autogenerated)

func (*Element) Ondragleave

func (e *Element) Ondragleave(attr_ondragleave ...string) *Element

Ondragleave is the attr_ondragleave attribute. (Autogenerated)

func (*Element) Ondragover

func (e *Element) Ondragover(attr_ondragover ...string) *Element

Ondragover is the attr_ondragover attribute. (Autogenerated)

func (*Element) Ondragstart

func (e *Element) Ondragstart(attr_ondragstart ...string) *Element

Ondragstart is the attr_ondragstart attribute. (Autogenerated)

func (*Element) Ondrop

func (e *Element) Ondrop(attr_ondrop ...string) *Element

Ondrop is the attr_ondrop attribute. (Autogenerated)

func (*Element) Ondurationchange

func (e *Element) Ondurationchange(attr_ondurationchange ...string) *Element

Ondurationchange is the attr_ondurationchange attribute. (Autogenerated)

func (*Element) Onemptied

func (e *Element) Onemptied(attr_onemptied ...string) *Element

Onemptied is the attr_onemptied attribute. (Autogenerated)

func (*Element) Onended

func (e *Element) Onended(attr_onended ...string) *Element

Onended is the attr_onended attribute. (Autogenerated)

func (*Element) Onerror

func (e *Element) Onerror(attr_onerror ...string) *Element

Onerror is the attr_onerror attribute. (Autogenerated)

func (*Element) Onfocus

func (e *Element) Onfocus(attr_onfocus ...string) *Element

Onfocus is the attr_onfocus attribute. (Autogenerated)

func (*Element) Onhashchange

func (e *Element) Onhashchange(attr_onhashchange ...string) *Element

Onhashchange is the attr_onhashchange attribute. (Autogenerated)

func (*Element) Oninput

func (e *Element) Oninput(attr_oninput ...string) *Element

Oninput is the attr_oninput attribute. (Autogenerated)

func (*Element) Oninvalid

func (e *Element) Oninvalid(attr_oninvalid ...string) *Element

Oninvalid is the attr_oninvalid attribute. (Autogenerated)

func (*Element) Onkeydown

func (e *Element) Onkeydown(attr_onkeydown ...string) *Element

Onkeydown is the attr_onkeydown attribute. (Autogenerated)

func (*Element) Onkeypress

func (e *Element) Onkeypress(attr_onkeypress ...string) *Element

Onkeypress is the attr_onkeypress attribute. (Autogenerated)

func (*Element) Onkeyup

func (e *Element) Onkeyup(attr_onkeyup ...string) *Element

Onkeyup is the attr_onkeyup attribute. (Autogenerated)

func (*Element) Onload

func (e *Element) Onload(attr_onload ...string) *Element

Onload is the attr_onload attribute. (Autogenerated)

func (*Element) Onloadeddata

func (e *Element) Onloadeddata(attr_onloadeddata ...string) *Element

Onloadeddata is the attr_onloadeddata attribute. (Autogenerated)

func (*Element) Onloadedmetadata

func (e *Element) Onloadedmetadata(attr_onloadedmetadata ...string) *Element

Onloadedmetadata is the attr_onloadedmetadata attribute. (Autogenerated)

func (*Element) Onloadstart

func (e *Element) Onloadstart(attr_onloadstart ...string) *Element

Onloadstart is the attr_onloadstart attribute. (Autogenerated)

func (*Element) Onmousedown

func (e *Element) Onmousedown(attr_onmousedown ...string) *Element

Onmousedown is the attr_onmousedown attribute. (Autogenerated)

func (*Element) Onmousemove

func (e *Element) Onmousemove(attr_onmousemove ...string) *Element

Onmousemove is the attr_onmousemove attribute. (Autogenerated)

func (*Element) Onmouseout

func (e *Element) Onmouseout(attr_onmouseout ...string) *Element

Onmouseout is the attr_onmouseout attribute. (Autogenerated)

func (*Element) Onmouseover

func (e *Element) Onmouseover(attr_onmouseover ...string) *Element

Onmouseover is the attr_onmouseover attribute. (Autogenerated)

func (*Element) Onmouseup

func (e *Element) Onmouseup(attr_onmouseup ...string) *Element

Onmouseup is the attr_onmouseup attribute. (Autogenerated)

func (*Element) Onmousewheel

func (e *Element) Onmousewheel(attr_onmousewheel ...string) *Element

Onmousewheel is the attr_onmousewheel attribute. (Autogenerated)

func (*Element) Onoffline

func (e *Element) Onoffline(attr_onoffline ...string) *Element

Onoffline is the attr_onoffline attribute. (Autogenerated)

func (*Element) Ononline

func (e *Element) Ononline(attr_ononline ...string) *Element

Ononline is the attr_ononline attribute. (Autogenerated)

func (*Element) Onpagehide

func (e *Element) Onpagehide(attr_onpagehide ...string) *Element

Onpagehide is the attr_onpagehide attribute. (Autogenerated)

func (*Element) Onpageshow

func (e *Element) Onpageshow(attr_onpageshow ...string) *Element

Onpageshow is the attr_onpageshow attribute. (Autogenerated)

func (*Element) Onpaste

func (e *Element) Onpaste(attr_onpaste ...string) *Element

Onpaste is the attr_onpaste attribute. (Autogenerated)

func (*Element) Onpause

func (e *Element) Onpause(attr_onpause ...string) *Element

Onpause is the attr_onpause attribute. (Autogenerated)

func (*Element) Onplay

func (e *Element) Onplay(attr_onplay ...string) *Element

Onplay is the attr_onplay attribute. (Autogenerated)

func (*Element) Onplaying

func (e *Element) Onplaying(attr_onplaying ...string) *Element

Onplaying is the attr_onplaying attribute. (Autogenerated)

func (*Element) Onpopstate

func (e *Element) Onpopstate(attr_onpopstate ...string) *Element

Onpopstate is the attr_onpopstate attribute. (Autogenerated)

func (*Element) Onprogress

func (e *Element) Onprogress(attr_onprogress ...string) *Element

Onprogress is the attr_onprogress attribute. (Autogenerated)

func (*Element) Onratechange

func (e *Element) Onratechange(attr_onratechange ...string) *Element

Onratechange is the attr_onratechange attribute. (Autogenerated)

func (*Element) Onreset

func (e *Element) Onreset(attr_onreset ...string) *Element

Onreset is the attr_onreset attribute. (Autogenerated)

func (*Element) Onresize

func (e *Element) Onresize(attr_onresize ...string) *Element

Onresize is the attr_onresize attribute. (Autogenerated)

func (*Element) Onscroll

func (e *Element) Onscroll(attr_onscroll ...string) *Element

Onscroll is the attr_onscroll attribute. (Autogenerated)

func (*Element) Onsearch

func (e *Element) Onsearch(attr_onsearch ...string) *Element

Onsearch is the attr_onsearch attribute. (Autogenerated)

func (*Element) Onseeked

func (e *Element) Onseeked(attr_onseeked ...string) *Element

Onseeked is the attr_onseeked attribute. (Autogenerated)

func (*Element) Onseeking

func (e *Element) Onseeking(attr_onseeking ...string) *Element

Onseeking is the attr_onseeking attribute. (Autogenerated)

func (*Element) Onselect

func (e *Element) Onselect(attr_onselect ...string) *Element

Onselect is the attr_onselect attribute. (Autogenerated)

func (*Element) Onshow

func (e *Element) Onshow(attr_onshow ...string) *Element

Onshow is the attr_onshow attribute. (Autogenerated)

func (*Element) Onstalled

func (e *Element) Onstalled(attr_onstalled ...string) *Element

Onstalled is the attr_onstalled attribute. (Autogenerated)

func (*Element) Onstorage

func (e *Element) Onstorage(attr_onstorage ...string) *Element

Onstorage is the attr_onstorage attribute. (Autogenerated)

func (*Element) Onsubmit

func (e *Element) Onsubmit(attr_onsubmit ...string) *Element

Onsubmit is the attr_onsubmit attribute. (Autogenerated)

func (*Element) Onsuspend

func (e *Element) Onsuspend(attr_onsuspend ...string) *Element

Onsuspend is the attr_onsuspend attribute. (Autogenerated)

func (*Element) Ontimeupdate

func (e *Element) Ontimeupdate(attr_ontimeupdate ...string) *Element

Ontimeupdate is the attr_ontimeupdate attribute. (Autogenerated)

func (*Element) Ontoggle

func (e *Element) Ontoggle(attr_ontoggle ...string) *Element

Ontoggle is the attr_ontoggle attribute. (Autogenerated)

func (*Element) Onunload

func (e *Element) Onunload(attr_onunload ...string) *Element

Onunload is the attr_onunload attribute. (Autogenerated)

func (*Element) Onvolumechange

func (e *Element) Onvolumechange(attr_onvolumechange ...string) *Element

Onvolumechange is the attr_onvolumechange attribute. (Autogenerated)

func (*Element) Onwaiting

func (e *Element) Onwaiting(attr_onwaiting ...string) *Element

Onwaiting is the attr_onwaiting attribute. (Autogenerated)

func (*Element) Onwheel

func (e *Element) Onwheel(attr_onwheel ...string) *Element

Onwheel is the attr_onwheel attribute. (Autogenerated)

func (*Element) Optgroup

func (e *Element) Optgroup(t ...string) *Element

func (*Element) Option

func (e *Element) Option(t ...string) *Element

func (*Element) Output

func (e *Element) Output(t ...string) *Element

func (*Element) P

func (e *Element) P(t ...string) *Element

func (*Element) Param

func (e *Element) Param(t ...string) *Element

func (*Element) Pre

func (e *Element) Pre(t ...string) *Element

func (*Element) Progress

func (e *Element) Progress(t ...string) *Element

func (*Element) Q

func (e *Element) Q(t ...string) *Element

func (*Element) RenderBuffer

func (e *Element) RenderBuffer(buf Buffer, templateData any) Buffer

Render element to buffer

func (*Element) Rp

func (e *Element) Rp(t ...string) *Element

func (*Element) Rt

func (e *Element) Rt(t ...string) *Element

func (*Element) Ruby

func (e *Element) Ruby(t ...string) *Element

func (*Element) S

func (e *Element) S(t ...string) *Element

func (*Element) Samp

func (e *Element) Samp(t ...string) *Element

func (*Element) Script

func (e *Element) Script(src string, useWasm bool, typ ...string) *Element

Append a script to an element. If the GOOS == JS and GOARCH == wasm, the script will be appended to the document head instead.

func (*Element) ScriptInline

func (e *Element) ScriptInline(sourceCode string, useWasm bool, typ ...string) *Element

Append a script with sourcecode to an element.

  • If the GOOS == JS and GOARCH == wasm, the script will be appended to the document head instead.
  • Returns nil if GOOS == JS and GOARCH == wasm.

func (*Element) Section

func (e *Element) Section(t ...string) *Element

func (*Element) Select

func (e *Element) Select(t ...string) *Element

func (*Element) SetAttr added in v1.2.4

func (e *Element) SetAttr(name string, values ...string) *Element

func (*Element) SetBool

func (e *Element) SetBool(name string, val bool) *Element

func (*Element) SetSemiColon

func (e *Element) SetSemiColon(name string, values ...string) *Element

func (*Element) Small

func (e *Element) Small(t ...string) *Element

func (*Element) Source

func (e *Element) Source(t ...string) *Element

func (*Element) Span

func (e *Element) Span(t ...string) *Element

func (*Element) Src

func (e *Element) Src(src string) *Element

func (*Element) String

func (e *Element) String() string

func (*Element) Strong

func (e *Element) Strong(t ...string) *Element

func (*Element) Style

func (e *Element) Style(styles ...string) *Element

func (*Element) StyleBlock

func (e *Element) StyleBlock(sourceCode ...string) *Element

func (*Element) StyleSheet

func (e *Element) StyleSheet(src string, rel string) *Element

func (*Element) Sub

func (e *Element) Sub(t ...string) *Element

func (*Element) Summary

func (e *Element) Summary(t ...string) *Element

func (*Element) Sup

func (e *Element) Sup(t ...string) *Element

func (*Element) Table

func (e *Element) Table(t ...string) *Element

func (*Element) Tbody

func (e *Element) Tbody(t ...string) *Element

func (*Element) Td

func (e *Element) Td(t ...string) *Element

func (*Element) TextAfter

func (e *Element) TextAfter() *Element

func (*Element) Textarea

func (e *Element) Textarea(t ...string) *Element

func (*Element) Tfoot

func (e *Element) Tfoot(t ...string) *Element

func (*Element) Th

func (e *Element) Th(t ...string) *Element

func (*Element) Thead

func (e *Element) Thead(t ...string) *Element

func (*Element) Time

func (e *Element) Time(t ...string) *Element

func (*Element) Tr

func (e *Element) Tr(t ...string) *Element

func (*Element) Track

func (e *Element) Track(t ...string) *Element

func (*Element) U

func (e *Element) U(t ...string) *Element

func (*Element) Ul

func (e *Element) Ul(t ...string) *Element

func (*Element) Var

func (e *Element) Var(t ...string) *Element

func (*Element) Video

func (e *Element) Video(t ...string) *Element

func (*Element) Wbr

func (e *Element) Wbr(t ...string) *Element

func (*Element) Width

func (e *Element) Width(attr_width string) *Element

Width is the attr_width attribute. (Autogenerated)

type Elements

type Elements []*Element

func (Elements) ForEach

func (e Elements) ForEach(fn func(*Element) bool)

Return false to stop the loop

func (Elements) RecursiveForEach

func (e Elements) RecursiveForEach(maxLevel int, fn func(*Element) bool)

Return false to stop the loop

func (Elements) String

func (e Elements) String() string

type FORMTYPES added in v1.1.8

type FORMTYPES string
const (
	FORMTYP_TEXT     FORMTYPES = "text"
	FORMTYP_CHECKBOX FORMTYPES = "checkbox"
	FORMTYP_NUMBER   FORMTYPES = "number"
	FORMTYP_DATETIME FORMTYPES = "datetime-local"
	FORMTYP_FILE     FORMTYPES = "file"
	FORMTYP_STRUCT   FORMTYPES = "struct"
)

func ReflectInputType added in v1.1.8

func ReflectInputType(val any) FORMTYPES

func (FORMTYPES) Equals added in v1.1.8

func (ft FORMTYPES) Equals(other FORMTYPES) bool
type Logo struct {
	URL         URL
	Image       string
	LeftOrRight bool
}

type URL

type URL struct {
	Name        string // Name of the URL
	URL         string // URL is the URL to the resource.
	Icon        string // Icon is the URL to the icon of the resource.
	LeftOrRight bool   // true = left, false = right
}

type URLs

type URLs []URL

func (URLs) GetName

func (u URLs) GetName(name string) (URL, error)

func (URLs) GetURL

func (u URLs) GetURL(url string) (URL, error)

func (URLs) Len

func (u URLs) Len() int

func (URLs) Less

func (u URLs) Less(i, j int) bool

func (URLs) Swap

func (u URLs) Swap(i, j int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL