Documentation ¶
Index ¶
- type EmbGUI
- type EmbNode
- func (n *EmbNode) A(text string, href string) *EmbNode
- func (n *EmbNode) ActionButton(text string, action string) *EmbNode
- func (n *EmbNode) Box() *EmbNode
- func (n *EmbNode) Buttons() *EmbNode
- func (n *EmbNode) CustomTag(tag string, id string, class string) *EmbNode
- func (n *EmbNode) DelButton(text string, action string) *EmbNode
- func (n *EmbNode) Div(id string, style string, text string) *EmbNode
- func (n *EmbNode) Em(text string) *EmbNode
- func (n *EmbNode) FileUpload(action string, label string, name string) *EmbNode
- func (n *EmbNode) Form(action string, method string) *EmbNode
- func (n *EmbNode) FormButton(text string) *EmbNode
- func (n *EmbNode) FormCheckbox(label string, name string) *EmbNode
- func (n *EmbNode) FormInput(label string, hideLabel bool, name string, value string) *EmbNode
- func (n *EmbNode) FormRadio(label string, name string) *EmbNode
- func (n *EmbNode) FormRadioOption(label string, name string) *EmbNode
- func (n *EmbNode) FormSelect(label string, name string) *EmbNode
- func (n *EmbNode) FormSelectOption(value string, text string) *EmbNode
- func (n *EmbNode) FormTextArea(name string, rows int, text string) *EmbNode
- func (n *EmbNode) GenTableBody(header []string) *EmbNode
- func (n *EmbNode) GenTiles(data ...Tile) *EmbNode
- func (n *EmbNode) H1(text string) *EmbNode
- func (n *EmbNode) H2(text string) *EmbNode
- func (n *EmbNode) H3(text string) *EmbNode
- func (n *EmbNode) H4(text string) *EmbNode
- func (n *EmbNode) H5(text string) *EmbNode
- func (n *EmbNode) HeadlessRender() string
- func (n *EmbNode) Hr() *EmbNode
- func (n *EmbNode) Li(text string) *EmbNode
- func (n *EmbNode) LinkButton(text string, href string) *EmbNode
- func (n *EmbNode) Message(text string, color string) *EmbNode
- func (n *EmbNode) MiniActionButton(text string, action string) *EmbNode
- func (n *EmbNode) MiniDelButton(text string, action string) *EmbNode
- func (n *EmbNode) MiniLinkButton(text string, href string) *EmbNode
- func (n *EmbNode) P(text string) *EmbNode
- func (n *EmbNode) Pre(text string, class string) *EmbNode
- func (n *EmbNode) RawHTML(html string) *EmbNode
- func (n *EmbNode) RenderPage() (string, error)
- func (n *EmbNode) SearchForm(action string, value string) *EmbNode
- func (n *EmbNode) Strong(text string) *EmbNode
- func (n *EmbNode) Td(text string) *EmbNode
- func (n *EmbNode) Tr() *EmbNode
- func (n *EmbNode) TwoColumns() (*EmbNode, *EmbNode)
- func (n *EmbNode) Ul() *EmbNode
- type MenuItem
- type Tile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmbGUI ¶
type EmbGUI struct { CSS string Size string CustomHead string // contains filtered or unexported fields }
EmbGUI is a HTML page, with one root EmbNode with many children
func New ¶
New creates a new page with a tile and a side menu usually it's defined once as a project-wide template you may customize NavTheme and NavLink after creation NavTheme uses bulma's colors (see https://bulma.io/documentation/elements/button/#colors) NavLink is a URL for navbar's title
type EmbNode ¶
type EmbNode struct { Text string Href string Action string Method string HTMLTag string Type string Class string Style string Name string ID string Enctype string Placeholder string Value string Rows int Unsafe bool Root bool GUIConfig *EmbGUI Children []*EmbNode // contains filtered or unexported fields }
EmbNode is a HTML element
func NewHandle ¶ added in v0.5.1
func NewHandle() *EmbNode
NewHandle generates an empty handle to generate headless partials
func (*EmbNode) ActionButton ¶
ActionButton generates POST button wrapped into a hidden form It's like LinkButton, but uses POST instead of GET
func (*EmbNode) DelButton ¶
DelButton generates DEL button wrapped into a hidden form your framework should support hidden _method tag
func (*EmbNode) FileUpload ¶ added in v0.5.1
FileUpload generates a file upload form
func (*EmbNode) FormButton ¶
FormButton generates a submit button inside a form
func (*EmbNode) FormCheckbox ¶ added in v0.5.1
FormCheckbox generates a checkbox inside form
func (*EmbNode) FormRadio ¶ added in v0.5.1
FormRadio generates radio wrapper inside form Use with FormRadioOption
func (*EmbNode) FormRadioOption ¶ added in v0.5.1
FormRadioOption add radio option inside radio wrapper
func (*EmbNode) FormSelect ¶ added in v0.5.1
FormSelect generates select inside form Use with FormSelectOption
func (*EmbNode) FormSelectOption ¶ added in v0.5.1
FormSelectOption add option inside select html tag
func (*EmbNode) FormTextArea ¶
FormTextArea generates a textarea inside a form
func (*EmbNode) GenTableBody ¶
GenTableBody helps generate html table it returns tbody from inside the table, not the table itself, so you can add Tr/Td to it
tbody := page.GenTableBody([]string{"id", "name", "surname"}) row := tbody.Tr() row.Td("1") row.Td("john") row.Td("smith")
func (*EmbNode) GenTiles ¶
GenTiles generates set of tiles
page.GenTiles(embgui.Tile{Title: "7", Subtitle: "new users"}, embgui.Tile{Title: "71", Subtitle: "new sales"}, embgui.Tile{Title: "90%", Subtitle: "CPU usage"}, embgui.Tile{Title: "71%", Subtitle: "disk free"})
func (*EmbNode) HeadlessRender ¶ added in v0.5.1
HeadlessRender HTML element and its child nodes if you don't want to escape text inside the tag, set Unsafe to true
func (*EmbNode) LinkButton ¶
LinkButton generates a link styled as button
func (*EmbNode) Message ¶
Message generates pre-styled message/tip div - alerts etc color can be one of bulma's colors (see https://bulma.io/documentation/elements/button/#colors)
func (*EmbNode) MiniActionButton ¶
MiniActionButton generates POST button wrapped into a hidden form it's good for buttons inside tables
func (*EmbNode) MiniDelButton ¶
MiniDelButton generates DEL button wrapped into a hidden form it's good for buttons inside tables your framework should support hidden _method tag
func (*EmbNode) MiniLinkButton ¶
MiniLinkButton generates a link styled as button, just like LinkButton(), but smaller it's good for links inside tables
func (*EmbNode) RenderPage ¶
RenderPage renders template with top-menu, root EmbNode element and its children
func (*EmbNode) SearchForm ¶
SearchForm generates predefined search form action is a URL we use to do a GET request with a "search" param
func (*EmbNode) TwoColumns ¶
TwoColumns generates 2 column layout and returns 2 EmbNode pointers
col1, col2 := TwoColumns() col1.H1("hello") col2.H2("world")
type Tile ¶
Tile represents single tile https://bulma.io/documentation/layout/tiles/ see GenTiles()