Documentation
¶
Index ¶
- Constants
- Variables
- type BKGCOLOR
- type COLOR
- type CONTAINER_WIDTH
- type DELETE_TYPE
- type HERO_HEIGHT
- type HeadItem
- type ICKButton
- func (btn *ICKButton) BuildTag() ickcore.Tag
- func (btn *ICKButton) Clone() *ICKButton
- func (btn *ICKButton) NeedRendering() bool
- func (btn *ICKButton) ParseHRef(rawurl string) *ICKButton
- func (btn *ICKButton) RenderContent(out io.Writer) error
- func (btn *ICKButton) SetColor(c COLOR) *ICKButton
- func (btn *ICKButton) SetDisabled(f bool) *ICKButton
- func (btn *ICKButton) SetHRef(u url.URL) *ICKButton
- func (btn *ICKButton) SetIcon(icon ICKIcon, closing bool) *ICKButton
- func (btn *ICKButton) SetId(id string) *ICKButton
- func (btn *ICKButton) SetLoading(f bool) *ICKButton
- func (btn *ICKButton) SetOutlined(f bool) *ICKButton
- func (btn *ICKButton) SetRounded(f bool) *ICKButton
- func (btn *ICKButton) SetSize(s SIZE) *ICKButton
- func (btn *ICKButton) SetTitle(title string) *ICKButton
- type ICKCard
- type ICKDelete
- type ICKElem
- type ICKHero
- type ICKIcon
- type ICKImage
- func (img *ICKImage) BuildTag() ickcore.Tag
- func (img *ICKImage) NeedRendering() bool
- func (img *ICKImage) ParseSrcURL(rawUrl string) *ICKImage
- func (img *ICKImage) RenderContent(out io.Writer) error
- func (img *ICKImage) SetAlt(alt string) *ICKImage
- func (img *ICKImage) SetNoCrop(f bool) *ICKImage
- func (img *ICKImage) SetRounded(f bool) *ICKImage
- func (img *ICKImage) SetSize(s IMG_SIZE) *ICKImage
- type ICKInputField
- func (in *ICKInputField) BuildTag() ickcore.Tag
- func (in *ICKInputField) RenderContent(out io.Writer) error
- func (in *ICKInputField) SetCanToggleVisibility(can bool) *ICKInputField
- func (in *ICKInputField) SetDisabled(f bool) *ICKInputField
- func (in *ICKInputField) SetHelp(help string) *ICKInputField
- func (in *ICKInputField) SetHidden(h bool) *ICKInputField
- func (in *ICKInputField) SetIcon(icon ICKIcon, closing bool) *ICKInputField
- func (in *ICKInputField) SetLabel(lbl string) *ICKInputField
- func (in *ICKInputField) SetReadOnly(ro bool) *ICKInputField
- func (in *ICKInputField) SetState(st INPUT_STATE) *ICKInputField
- type ICKLink
- type ICKMedia
- type ICKMenu
- func (mnu *ICKMenu) AddItem(key string, itmtyp MENUITEM_TYPE, txt string) *IckMenuItem
- func (mnu *ICKMenu) At(index int) *IckMenuItem
- func (mnu *ICKMenu) BuildTag() ickcore.Tag
- func (src ICKMenu) Clone() *ICKMenu
- func (mnu *ICKMenu) Item(key string) *IckMenuItem
- func (mnu *ICKMenu) NeedRendering() bool
- func (mnu *ICKMenu) RenderContent(out io.Writer) error
- func (mnu *ICKMenu) SetActiveItem(key string) *ICKMenu
- func (mnu *ICKMenu) SetSize(sz SIZE) *ICKMenu
- func (mnu *ICKMenu) SetType(t MENU_TYPE) *ICKMenu
- type ICKMessage
- func (msg *ICKMessage) BuildTag() ickcore.Tag
- func (msg *ICKMessage) RenderContent(out io.Writer) error
- func (msg *ICKMessage) SetColor(c COLOR) *ICKMessage
- func (msg *ICKMessage) SetDeletable(id string) *ICKMessage
- func (msg *ICKMessage) SetHeader(header ickcore.HTMLString) *ICKMessage
- func (msg *ICKMessage) SetSize(s SIZE) *ICKMessage
- type ICKNavbar
- func (nav *ICKNavbar) AddItem(key string, itmtyp NAVBARITEM_TYPE, content ickcore.ContentComposer) *ICKNavbarItem
- func (nav *ICKNavbar) At(index int) *ICKNavbarItem
- func (nav *ICKNavbar) BuildTag() ickcore.Tag
- func (src ICKNavbar) Clone() *ICKNavbar
- func (nav *ICKNavbar) Item(key string) *ICKNavbarItem
- func (nav *ICKNavbar) NeedRendering() bool
- func (nav *ICKNavbar) RenderContent(out io.Writer) error
- func (nav *ICKNavbar) SetActiveItem(key string) *ICKNavbar
- type ICKNavbarItem
- func (navi *ICKNavbarItem) AddItem(key string, itmtyp NAVBARITEM_TYPE, content ickcore.ContentComposer) *ICKNavbarItem
- func (navi *ICKNavbarItem) At(index int) *ICKNavbarItem
- func (navi *ICKNavbarItem) BuildTag() ickcore.Tag
- func (navi ICKNavbarItem) Clone() *ICKNavbarItem
- func (navi *ICKNavbarItem) Item(key string) *ICKNavbarItem
- func (navi *ICKNavbarItem) ParseHRef(rawUrl string) *ICKNavbarItem
- func (navi *ICKNavbarItem) ParseImageSrc(rawUrl string) *ICKNavbarItem
- func (navi *ICKNavbarItem) RenderContent(out io.Writer) error
- func (navi *ICKNavbarItem) SetHRef(u url.URL) *ICKNavbarItem
- func (navi *ICKNavbarItem) SetImageSrc(u url.URL) *ICKNavbarItem
- type ICKSpinner
- type ICKTagLabel
- func (t *ICKTagLabel) BuildTag() ickcore.Tag
- func (t *ICKTagLabel) RenderContent(out io.Writer) error
- func (t *ICKTagLabel) SetCanDelete(can bool) *ICKTagLabel
- func (t *ICKTagLabel) SetHeader(text string, c COLOR) *ICKTagLabel
- func (t *ICKTagLabel) SetRounded(f bool) *ICKTagLabel
- func (t *ICKTagLabel) SetSize(s TAGLABEL_SIZE) *ICKTagLabel
- type ICKTitle
- type IMG_SIZE
- type INPUT_STATE
- type IckMenuItem
- type MENUITEM_TYPE
- type MENU_TYPE
- type NAVBARITEM_TYPE
- type Page
- func (pg Page) AbsURL() *url.URL
- func (f *Page) AddHeadItem(tagname string, attributes string) *Page
- func (pg *Page) Body() *ICKElem
- func (pg *Page) ParseURL(rawHTMLUrl string) (err error)
- func (pg *Page) RMeta() *ickcore.RMetaData
- func (pg Page) RelURL() *url.URL
- func (pg *Page) RenderContent(out io.Writer) (err error)
- func (pg *Page) WasmScript() *ickcore.HTMLString
- func (pg Page) WriteFile(outputpath string) (err error)
- type SIZE
- type TAGLABEL_SIZE
- type TXTCOLOR
- type WebSite
- func (w *WebSite) AddPage(lang string, rawUrl string) *Page
- func (w *WebSite) CopyToAssets(srcs ...string) error
- func (w *WebSite) Page(rawUrl string) *Page
- func (w WebSite) ToAbsURL(rawurl string) *url.URL
- func (w WebSite) ToAbsURLString(rawurl string) string
- func (w WebSite) WriteFiles() (n int, err error)
Constants ¶
const ( COLOR_NONE COLOR = "" COLOR_WHITE COLOR = "is-white" COLOR_WHITE_BIS COLOR = "is-white-bis" COLOR_WHITE_TER COLOR = "is-white-ter" COLOR_BLACK COLOR = "is-black" COLOR_BLACK_BIS COLOR = "is-black-bis" COLOR_BLACK_TER COLOR = "is-black-ter" COLOR_LIGHT COLOR = "is-light" COLOR_DARK COLOR = "is-dark" COLOR_PRIMARY COLOR = "is-primary" COLOR_LINK COLOR = "is-link" COLOR_INFO COLOR = "is-info" COLOR_SUCCESS COLOR = "is-success" COLOR_WARNING COLOR = "is-warning" COLOR_DANGER COLOR = "is-danger" COLOR_GREY COLOR = "is-grey" COLOR_GREY_DARKER COLOR = "is-grey-darker" COLOR_GREY_DARK COLOR = "is-grey-dark" COLOR_GREY_LIGHT COLOR = "is-grey-light" COLOR_GREY_LIGHTER COLOR = "is-grey-lighter" COLOR_OPTIONS string = string(COLOR_GREY + " " + COLOR_WHITE + " " + COLOR_WHITE_BIS + " " + COLOR_WHITE_TER + " " + COLOR_BLACK + " " + COLOR_BLACK_BIS + " " + COLOR_BLACK_TER + " " + COLOR_LIGHT + " " + COLOR_DARK + " " + COLOR_PRIMARY + " " + COLOR_LINK + " " + COLOR_INFO + " " + COLOR_SUCCESS + " " + COLOR_WARNING + " " + COLOR_DANGER + " " + COLOR_GREY_DARKER + " " + COLOR_GREY_DARK + " " + COLOR_GREY_LIGHT + " " + COLOR_GREY_LIGHTER) )
const ( TXTCOLOR_WHITE TXTCOLOR = "has-text-white" TXTCOLOR_WHITE_BIS TXTCOLOR = "has-text-white-bis" TXTCOLOR_WHITE_TER TXTCOLOR = "has-text-white-ter" TXTCOLOR_BLACK TXTCOLOR = "has-text-black" TXTCOLOR_BLACK_BIS TXTCOLOR = "has-text-black-bis" TXTCOLOR_BLACK_TER TXTCOLOR = "has-text-black-ter" TXTCOLOR_LIGHT TXTCOLOR = "has-text-light" TXTCOLOR_DARK TXTCOLOR = "has-text-dark" TXTCOLOR_PRIMARY TXTCOLOR = "has-text-primary" TXTCOLOR_LINK TXTCOLOR = "has-text-link" TXTCOLOR_INFO TXTCOLOR = "has-text-info" TXTCOLOR_SUCCESS TXTCOLOR = "has-text-success" TXTCOLOR_WARNING TXTCOLOR = "has-text-warning" TXTCOLOR_DANGER TXTCOLOR = "has-text-danger" TXTCOLOR_PRIMARY_LIGHT TXTCOLOR = "has-text-primary-light" TXTCOLOR_LINK_LIGHT TXTCOLOR = "has-text-link-light" TXTCOLOR_INFO_LIGHT TXTCOLOR = "has-text-info-light" TXTCOLOR_SUCCESS_LIGHT TXTCOLOR = "has-text-success-light" TXTCOLOR_WARNING_LIGHT TXTCOLOR = "has-text-warning-light" TXTCOLOR_DANGER_LIGHT TXTCOLOR = "has-text-danger-light" TXTCOLOR_PRIMARY_DARK TXTCOLOR = "has-text-primary-dark" TXTCOLOR_LINK_DARK TXTCOLOR = "has-text-link-dark" TXTCOLOR_INFO_DARK TXTCOLOR = "has-text-info-dark" TXTCOLOR_SUCCESS_DARK TXTCOLOR = "has-text-success-dark" TXTCOLOR_WARNING_DARK TXTCOLOR = "has-text-warning-dark" TXTCOLOR_DANGER_DARK TXTCOLOR = "has-text-danger-dark" TXTCOLOR_GREY TXTCOLOR = "has-text-grey" TXTCOLOR_GREY_DARKER TXTCOLOR = "has-text-grey-darker" TXTCOLOR_GREY_DARK TXTCOLOR = "has-text-grey-dark" TXTCOLOR_GREY_LIGHT TXTCOLOR = "has-text-grey-light" TXTCOLOR_GREY_LIGHTER TXTCOLOR = "has-text-grey-lighter" TXTCOLOR_OPTIONS string = string(TXTCOLOR_GREY+" "+TXTCOLOR_WHITE+" "+TXTCOLOR_WHITE_BIS+" "+TXTCOLOR_WHITE_TER+" "+TXTCOLOR_BLACK+" "+TXTCOLOR_BLACK_BIS+" "+TXTCOLOR_BLACK_TER+" "+TXTCOLOR_LIGHT+" "+TXTCOLOR_DARK+" "+TXTCOLOR_PRIMARY+" "+TXTCOLOR_LINK+" "+TXTCOLOR_INFO+" "+TXTCOLOR_SUCCESS+" "+TXTCOLOR_WARNING+" "+TXTCOLOR_DANGER+" "+TXTCOLOR_GREY_DARKER+" "+TXTCOLOR_GREY_DARK+" "+TXTCOLOR_GREY_LIGHT+" "+TXTCOLOR_GREY_LIGHTER) + string(TXTCOLOR_PRIMARY_LIGHT+" "+TXTCOLOR_LINK_LIGHT+" "+TXTCOLOR_INFO_LIGHT+" "+TXTCOLOR_SUCCESS_LIGHT+" "+TXTCOLOR_WARNING_LIGHT+" "+TXTCOLOR_DANGER_LIGHT) + string(TXTCOLOR_PRIMARY_DARK+" "+TXTCOLOR_LINK_DARK+" "+TXTCOLOR_INFO_DARK+" "+TXTCOLOR_SUCCESS_DARK+" "+TXTCOLOR_WARNING_DARK+" "+TXTCOLOR_DANGER_DARK) )
const ( BKGCOLOR_WHITE BKGCOLOR = "has-background-white" BKGCOLOR_WHITE_BIS BKGCOLOR = "has-background-white-bis" BKGCOLOR_WHITE_TER BKGCOLOR = "has-background-white-ter" BKGCOLOR_BLACK BKGCOLOR = "has-background-black" BKGCOLOR_BLACK_BIS BKGCOLOR = "has-background-black-bis" BKGCOLOR_BLACK_TER BKGCOLOR = "has-background-black-ter" BKGCOLOR_LIGHT BKGCOLOR = "has-background-light" BKGCOLOR_DARK BKGCOLOR = "has-background-dark" BKGCOLOR_PRIMARY BKGCOLOR = "has-background-primary" BKGCOLOR_LINK BKGCOLOR = "has-background-link" BKGCOLOR_INFO BKGCOLOR = "has-background-info" BKGCOLOR_SUCCESS BKGCOLOR = "has-background-success" BKGCOLOR_WARNING BKGCOLOR = "has-background-warning" BKGCOLOR_DANGER BKGCOLOR = "has-background-danger" BKGCOLOR_PRIMARY_LIGHT BKGCOLOR = "has-background-primary-light" BKGCOLOR_LINK_LIGHT BKGCOLOR = "has-background-link-light" BKGCOLOR_INFO_LIGHT BKGCOLOR = "has-background-info-light" BKGCOLOR_SUCCESS_LIGHT BKGCOLOR = "has-background-success-light" BKGCOLOR_WARNING_LIGHT BKGCOLOR = "has-background-warning-light" BKGCOLOR_DANGER_LIGHT BKGCOLOR = "has-background-danger-light" BKGCOLOR_PRIMARY_DARK BKGCOLOR = "has-background-primary-dark" BKGCOLOR_LINK_DARK BKGCOLOR = "has-background-link-dark" BKGCOLOR_INFO_DARK BKGCOLOR = "has-background-info-dark" BKGCOLOR_SUCCESS_DARK BKGCOLOR = "has-background-success-dark" BKGCOLOR_WARNING_DARK BKGCOLOR = "has-background-warning-dark" BKGCOLOR_DANGER_DARK BKGCOLOR = "has-background-danger-dark" BKGCOLOR_GREY BKGCOLOR = "has-background-grey" BKGCOLOR_GREY_DARKER BKGCOLOR = "has-background-grey-darker" BKGCOLOR_GREY_DARK BKGCOLOR = "has-background-grey-dark" BKGCOLOR_GREY_LIGHT BKGCOLOR = "has-background-grey-light" BKGCOLOR_GREY_LIGHTER BKGCOLOR = "has-background-grey-lighter" BKGCOLOR_OPTIONS string = string(BKGCOLOR_GREY+" "+BKGCOLOR_WHITE+" "+BKGCOLOR_WHITE_BIS+" "+BKGCOLOR_WHITE_TER+" "+BKGCOLOR_BLACK+" "+BKGCOLOR_BLACK_BIS+" "+BKGCOLOR_BLACK_TER+" "+BKGCOLOR_LIGHT+" "+BKGCOLOR_DARK+" "+BKGCOLOR_PRIMARY+" "+BKGCOLOR_LINK+" "+BKGCOLOR_INFO+" "+BKGCOLOR_SUCCESS+" "+BKGCOLOR_WARNING+" "+BKGCOLOR_DANGER+" "+BKGCOLOR_GREY_DARKER+" "+BKGCOLOR_GREY_DARK+" "+BKGCOLOR_GREY_LIGHT+" "+BKGCOLOR_GREY_LIGHTER) + string(BKGCOLOR_PRIMARY_LIGHT+" "+BKGCOLOR_LINK_LIGHT+" "+BKGCOLOR_INFO_LIGHT+" "+BKGCOLOR_SUCCESS_LIGHT+" "+BKGCOLOR_WARNING_LIGHT+" "+BKGCOLOR_DANGER_LIGHT) + string(BKGCOLOR_PRIMARY_DARK+" "+BKGCOLOR_LINK_DARK+" "+BKGCOLOR_INFO_DARK+" "+BKGCOLOR_SUCCESS_DARK+" "+BKGCOLOR_WARNING_DARK+" "+BKGCOLOR_DANGER_DARK) )
const ( SIZE_SMALL SIZE = "is-small" SIZE_STD SIZE = "is-normal" SIZE_MEDIUM SIZE = "is-medium" SIZE_LARGE SIZE = "is-large" SIZE_OPTIONS string = string(SIZE_STD + " " + SIZE_SMALL + " " + SIZE_MEDIUM + " " + SIZE_LARGE) )
const ( HH_SMALL HERO_HEIGHT = "is-small" HH_STANDARD HERO_HEIGHT = "" HH_MEDIUM HERO_HEIGHT = "is-medium" HH_LARGE HERO_HEIGHT = "is-large" HH_HALFHEIGHT HERO_HEIGHT = "is-halfheight" HH_FULLFHEIGHT HERO_HEIGHT = "is-fullheight" HH_FULLFHEIGHT_WITH_NAVBAR HERO_HEIGHT = "is-fullheight-with-navbar" HH_OPTIONS string = string(HH_SMALL + " " + HH_MEDIUM + " " + HH_LARGE + " " + HH_HALFHEIGHT + " " + HH_FULLFHEIGHT + " " + HH_FULLFHEIGHT_WITH_NAVBAR) )
const ( IMG_16x16 IMG_SIZE = "is-16x16" IMG_24x24 IMG_SIZE = "is-24x24" IMG_32x32 IMG_SIZE = "is-32x32" IMG_48x48 IMG_SIZE = "is-48x48" IMG_64x64 IMG_SIZE = "is-64x64" IMG_96x96 IMG_SIZE = "is-96x96" IMG_128x128 IMG_SIZE = "is-128x128" IMG_RSQUARE IMG_SIZE = "is-fullwidth is-square" IMG_R1by1 IMG_SIZE = "is-fullwidth is-1by1" IMG_R5by4 IMG_SIZE = "is-fullwidth is-5by4" IMG_R4by3 IMG_SIZE = "is-fullwidth is-4by3" IMG_R3by2 IMG_SIZE = "is-fullwidth is-3by2" IMG_R5by3 IMG_SIZE = "is-fullwidth is-5by3" IMG_R16by9 IMG_SIZE = "is-fullwidth is-16by9" IMG_R2by1 IMG_SIZE = "is-fullwidth is-2by1" IMG_R3by1 IMG_SIZE = "is-fullwidth is-3by1" IMG_R4by5 IMG_SIZE = "is-fullwidth is-4by5" IMG_R3by4 IMG_SIZE = "is-fullwidth is-3by4" IMG_R2by3 IMG_SIZE = "is-fullwidth is-2by3" IMG_R3by5 IMG_SIZE = "is-fullwidth is-3by5" IMG_R9by16 IMG_SIZE = "is-fullwidth is-9by16" IMG_R1by2 IMG_SIZE = "is-fullwidth is-1by2" IMG_R1by3 IMG_SIZE = "is-fullwidth is-1by3" IMG_SIZE_OPTIONS string = string(IMG_16x16+" "+IMG_24x24+" "+IMG_32x32+" "+IMG_48x48+" "+IMG_64x64+" "+IMG_96x96+" "+IMG_128x128) + " " + string(IMG_RSQUARE+" "+IMG_R1by1+" "+IMG_R5by4+" "+IMG_R4by3+" "+IMG_R3by2+" "+IMG_R5by3+" "+IMG_R16by9+" "+IMG_R2by1+" "+IMG_R3by1+" "+IMG_R4by5+" "+IMG_R3by4+" "+IMG_R2by3+" "+IMG_R3by5+" "+IMG_R9by16+" "+IMG_R1by2+" "+IMG_R1by3) )
const ( TAGLBLSZ_STD TAGLABEL_SIZE = "is-normal" TAGLBLSZ_MEDIUM TAGLABEL_SIZE = "is-medium" TAGLBLSZ_LARGE TAGLABEL_SIZE = "is-large" TAGLBLSZ_OPTIONS string = string(TAGLBLSZ_STD + " " + TAGLBLSZ_MEDIUM + " " + TAGLBLSZ_LARGE) )
Variables ¶
var ( ErrBadHtmlFileExtention = errors.New("bad html file extension") ErrMissingFileName = errors.New("missing file name") )
Functions ¶
This section is empty.
Types ¶
type CONTAINER_WIDTH ¶
type CONTAINER_WIDTH string
const ( CONTWIDTH_NONE CONTAINER_WIDTH = "" CONTWIDTH_MAXDESKTOP CONTAINER_WIDTH = "is-max-desktop" // 960px in any cases CONTWIDTH_DESKTOP CONTAINER_WIDTH = "is-desktop" // 960px or 1152 px or 1344 px CONTWIDTH_MAXWIDESCREEN CONTAINER_WIDTH = "is-max-widescreen" // 1152 px CONTWIDTH_WIDESCREEN CONTAINER_WIDTH = "is-widescreen" // 1152 px or 1344 px CONTWIDTH_FULLHD CONTAINER_WIDTH = "is-fullhd" // 1344 px CONTWIDTH_FLUID CONTAINER_WIDTH = "is-fluid" // fullscreen + 32px margin CONTWIDTH_OPTIONS CONTAINER_WIDTH = CONTWIDTH_MAXDESKTOP + " " + CONTWIDTH_DESKTOP + " " + CONTWIDTH_MAXWIDESCREEN + " " + CONTWIDTH_WIDESCREEN + " " + CONTWIDTH_FULLHD + " " + CONTWIDTH_FLUID )
type DELETE_TYPE ¶
type DELETE_TYPE string
const ( DLTTYP_BUTTON DELETE_TYPE = "button" DLTTYP_ANCHOR DELETE_TYPE = "anchor" )
type ICKButton ¶
type ICKButton struct {
ickcore.BareSnippet
OpeningIcon ICKIcon // optional opening icon
Title string // html string
ClosingIcon ICKIcon // optional closing icon
// HRef defines the associated url link. HRef can be nil. If HRef is defined then the rendered element is a <a> tag, otherwise it's a <button> tag.
HRef *url.URL
IsOutlined bool // Outlined button style
IsRounded bool // Rounded button style
COLOR // rendering color
SIZE // button size
IsDisabled bool // Disabled state
IsLoading bool // Loading button state
}
ICKButton is an UISnippet registered with the ick-tag `ick-button`.
According to the ButtonType property, ICKButton can be used either as a standard <button> element but also as an anchor link or a submit or reset form input. The core text is handle with the Title html property, allowing simple text or complex rendering.
The IsDisabled property is directly handled by the embedded UISnippet.
var ( // IconVisibilityHidden *ICKIcon = Icon("bi bi-eye-slash-fill").SetColor(TXTCOLOR_PRIMARY) // IconVisibilityVisible *ICKIcon = Icon("bi bi-eye-fill").SetColor(TXTCOLOR_PRIMARY) BtnVisibilityHidden *ICKButton = Button("").SetIcon(*Icon("bi bi-eye-slash-fill").SetColor(TXTCOLOR_PRIMARY), false) BtnVisibilityVisible *ICKButton = Button("").SetIcon(*Icon("bi bi-eye-fill").SetColor(TXTCOLOR_PRIMARY), false) )
func (*ICKButton) BuildTag ¶
BuildTag builds the tag used to render the html element. The tagname depends on the button type.
func (*ICKButton) NeedRendering ¶
func (*ICKButton) RenderContent ¶
RenderContent writes the HTML string corresponding to the content of the HTML element.
func (*ICKButton) SetDisabled ¶
func (*ICKButton) SetLoading ¶
func (*ICKButton) SetOutlined ¶
func (*ICKButton) SetRounded ¶
type ICKCard ¶
type ICKCard struct {
ickcore.BareSnippet
// Optional title to display in the head of the card
Title ickcore.HTMLString
// the body of the card
Body ICKElem // rendered as <div class="card-content">
// Optional image to display on top of the card
Image *ICKImage
// contains filtered or unexported fields
}
The card is an HTMLSnippet. Use AddContent to setup the content of the card
func (*ICKCard) AddFooterItem ¶
func (card *ICKCard) AddFooterItem(item ickcore.HTMLString) *ICKCard
func (*ICKCard) BuildTag ¶
BuildTag builds the tag used to render the html element. Card Tag is a simple <div class="card"></div>
func (*ICKCard) RenderContent ¶
RenderContent writes the HTML string corresponding to the content of the HTML element. Card rendering renders the optional header withe the Title, the optional Image, the content, and a slice of footers
type ICKDelete ¶
type ICKDelete struct {
ickcore.BareSnippet
DELETE_TYPE
// The element id to remove from the DOM when the delete button is clicked
TargetId string
// styling
SIZE
}
func (*ICKDelete) BuildTag ¶
BuildTag builds the tag used to render the html element. Delete tag is a simple <button class="delete"></delete>
func (*ICKDelete) RenderContent ¶
Delete rendering is made by the tag attributes.
func (*ICKDelete) SetType ¶
func (t *ICKDelete) SetType(typ DELETE_TYPE) *ICKDelete
type ICKElem ¶
type ICKElem struct {
ickcore.BareSnippet
Body ickcore.ContentStack // HTML Element body. A stack of content composers to render.
}
ICKElem implements the Composer interface for a basic element
func Container ¶
func Container(w CONTAINER_WIDTH, attrs ...string) *ICKElem
Container allow centering element on larger viewport. See bulma container
func Elem ¶
func Elem(tagname string, attr string, body ...ickcore.ContentComposer) *ICKElem
Elem returns a new HTMLSnippet with a given tag name and a map of attributes.
func (*ICKElem) Append ¶
func (s *ICKElem) Append(content ...ickcore.ContentComposer) *ICKElem
Append
func (*ICKElem) BuildTag ¶
BuildTag builds the tag used to render the html element. This default implementation of BuildTag does nothing. So as the tag may have been preset before rendering.
func (ICKElem) NeedRendering ¶
func (*ICKElem) RenderContent ¶
RenderContent writes the HTML string corresponding to the content of the HTML element. The default implementation for an HTMLSnippet snippet is to render all the internal stack of composers inside an enclosed HTML tag.
type ICKHero ¶
type ICKHero struct {
ickcore.BareSnippet
Height HERO_HEIGHT // the height of the hero section,
InsideHead ickcore.ContentComposer
Title ICKTitle
Subtitle ICKTitle
Centered bool
CWidth CONTAINER_WIDTH
CTA ICKButton
InsideFoot ickcore.ContentComposer
}
type ICKIcon ¶
type ICKIcon struct {
ickcore.BareSnippet
// Key is the icon key that will be added to the <class attribute of the <i> element.
// Format of this key depends on the icon provider:
// - 'fas fa-{iconname}' for [font awesome icons]
// - 'bi-{iconname}' for [bootstrap icons]
// - 'mdi mdi{iconname}' for [material design icons]
//
// If the Key is empty nothing is rendered
//
// [font awesome icons]: https://fontawesome.com/icons
// [bootstrap icons]: https://icons.getbootstrap.com/
// [material design icons]: https://pictogrammers.com/library/mdi/
Key string
Text string // optional text
Color TXTCOLOR // icon color
}
func (*ICKIcon) NeedRendering ¶
func (*ICKIcon) RenderContent ¶
RenderContent writes the HTML string corresponding to the content of the HTML element.
type ICKImage ¶
type ICKImage struct {
ickcore.BareSnippet
Src *url.URL // the url for the source of the image
Alt string // the alternative text
Size IMG_SIZE // the size or the ratio of the image
IsRounded bool // Rounded image style
NoCrop bool // set to true to avoid to crop the image if its size does not fit the Size property. The image may be reduced or distord.
}
ICKImage is a typical img element embedded into a figure container specifying the image size. See bulma image
Background color can be setup by adding snipet classes.
func (*ICKImage) NeedRendering ¶
func (*ICKImage) ParseSrcURL ¶
ParseSrc parses rawurl to img.Src and returns img to allow chaining. Parsing errors are ignored and if any, Src may stay nil.
func (*ICKImage) RenderContent ¶
RenderContent writes the HTML string corresponding to the content of the HTML element.
func (*ICKImage) SetRounded ¶
type ICKInputField ¶
type ICKInputField struct {
ickcore.BareSnippet
// Optional label above the value
Label string
OpeningIcon ICKIcon // optional opening icon
Value string // The input value
IsHidden bool // Entered characters are hidden
ClosingIcon ICKIcon // optional closing icon
// Optional PlaceHolder string
PlaceHolder string
// Optional help text
Help string
// Input state: INPUT_STD, INPUT_SUCCESS, INPUT_WARNING, INPUT_ERROR, INPUT_LOADING
State INPUT_STATE
// ReadOnly input field
IsReadOnly bool
// TODO: ickui - ICKInputField add an icon to show/hide incase of hidden field
// CanToggleVisibility enables a toggle icon button right to the input.
// This button toggles the IsHidden status of the input field.
// ClosingIcon is ignored if CanToggleVisibility is enabled.
CanToggleVisibility bool
}
func InputField ¶
func InputField(id string, value string, placeholder string, attrs ...string) *ICKInputField
func (*ICKInputField) BuildTag ¶
func (in *ICKInputField) BuildTag() ickcore.Tag
BuildTag builds the tag used to render the html element.
func (*ICKInputField) RenderContent ¶
func (in *ICKInputField) RenderContent(out io.Writer) error
RenderContent writes the HTML string corresponding to the content of the HTML element.
func (*ICKInputField) SetCanToggleVisibility ¶
func (in *ICKInputField) SetCanToggleVisibility(can bool) *ICKInputField
func (*ICKInputField) SetDisabled ¶
func (in *ICKInputField) SetDisabled(f bool) *ICKInputField
func (*ICKInputField) SetHelp ¶
func (in *ICKInputField) SetHelp(help string) *ICKInputField
func (*ICKInputField) SetHidden ¶
func (in *ICKInputField) SetHidden(h bool) *ICKInputField
func (*ICKInputField) SetIcon ¶
func (in *ICKInputField) SetIcon(icon ICKIcon, closing bool) *ICKInputField
func (*ICKInputField) SetLabel ¶
func (in *ICKInputField) SetLabel(lbl string) *ICKInputField
func (*ICKInputField) SetReadOnly ¶
func (in *ICKInputField) SetReadOnly(ro bool) *ICKInputField
func (*ICKInputField) SetState ¶
func (in *ICKInputField) SetState(st INPUT_STATE) *ICKInputField
type ICKLink ¶
type ICKLink struct {
ickcore.BareSnippet
// HRef defines the associated url link.
// if nil the <a> tag is rendered without href attribute.
// Usually HRef is created calling TryParseHRef
HRef *url.URL
Body ickcore.ContentStack // HTML Element body. A stack of content composers to render.
}
ICKLink represents an HTML anchor link. It is part of the core icecake snippets.
func Link ¶
func Link(child ickcore.ContentComposer, attrlist ...string) *ICKLink
Link returns an HTML anchor link
func (*ICKLink) RenderContent ¶
RenderContent writes the HTML string corresponding to the content of the HTML element. The default implementation for an HTMLSnippet snippet is to render all the internal stack of composers inside an enclosed HTML tag.
type ICKMedia ¶
type ICKMedia struct {
ickcore.BareSnippet
Left ickcore.TagProvider
Middle ickcore.TagProvider
Right ickcore.TagProvider
}
func Media ¶
func Media(left ickcore.TagProvider, middle ickcore.TagProvider, right ickcore.TagProvider, attrs ...string) *ICKMedia
type ICKMenu ¶
type ICKMenu struct {
ickcore.BareSnippet
MENU_TYPE
SIZE
// contains filtered or unexported fields
}
ICKMenu is an icecake snippet providing the HTML rendering for a bulma menu.
func (*ICKMenu) AddItem ¶
func (mnu *ICKMenu) AddItem(key string, itmtyp MENUITEM_TYPE, txt string) *IckMenuItem
AddItem adds the item to the Menu
func (*ICKMenu) At ¶
func (mnu *ICKMenu) At(index int) *IckMenuItem
At returns the item at a given index. returns nil if index is out of range.
func (ICKMenu) Clone ¶
Clone clones this Menu and all its items and subitem, keeping their attributes their item index and their key.
func (*ICKMenu) Item ¶
func (mnu *ICKMenu) Item(key string) *IckMenuItem
Item returns the first item found with the given key, walking through all levels. returns nil if key is not found
func (*ICKMenu) NeedRendering ¶
func (*ICKMenu) RenderContent ¶
RenderContent writes the HTML string corresponding to the content of the HTML element.
func (*ICKMenu) SetActiveItem ¶
SetActiveItem look for the key item (or subitem) and sets its IsActive flag. warning: does not unset other actve items if any.
type ICKMessage ¶
type ICKMessage struct {
ickcore.BareSnippet
// optional header to display on top of the message
Header ickcore.HTMLString
// the body of the message
Msg ickcore.ContentStack
// set to true to display the delete button and allow user to delete the message
CanDelete bool
// COLOR define the color of the message
COLOR
// SIZE define the size of the message
SIZE
}
ICKMessage is an icecake snippet providing the HTML rendering for a bulma message.
func Message ¶
func Message(cnt ickcore.ContentComposer) *ICKMessage
func (*ICKMessage) BuildTag ¶
func (msg *ICKMessage) BuildTag() ickcore.Tag
BuildTag returns tag <div class="message {classes}" {attributes}>
func (*ICKMessage) RenderContent ¶
func (msg *ICKMessage) RenderContent(out io.Writer) error
RenderContent writes the HTML string corresponding to the content of the HTML element.
func (*ICKMessage) SetColor ¶
func (msg *ICKMessage) SetColor(c COLOR) *ICKMessage
SetColor set a message color
func (*ICKMessage) SetDeletable ¶
func (msg *ICKMessage) SetDeletable(id string) *ICKMessage
SetDeletable make this message delatable by rendering the delete button. A deletable message must have an id. Dos nothing if id is empty.
func (*ICKMessage) SetHeader ¶
func (msg *ICKMessage) SetHeader(header ickcore.HTMLString) *ICKMessage
SetHeader set a message header
func (*ICKMessage) SetSize ¶
func (msg *ICKMessage) SetSize(s SIZE) *ICKMessage
SetSize set the size of the message
type ICKNavbar ¶
type ICKNavbar struct {
// Styling properties
// contains filtered or unexported fields
}
ICKNavbar is an icecake snippet providing the HTML rendering for a bulma navbar.
func (*ICKNavbar) AddItem ¶
func (nav *ICKNavbar) AddItem(key string, itmtyp NAVBARITEM_TYPE, content ickcore.ContentComposer) *ICKNavbarItem
AddItem adds the item to the navbar
func (*ICKNavbar) At ¶
func (nav *ICKNavbar) At(index int) *ICKNavbarItem
At returns the item at a given index. returns nil if index is out of range.
func (ICKNavbar) Clone ¶
Clone clones this navbar and all its items and subitem, keeping their attributes their item index and their key.
func (*ICKNavbar) Item ¶
func (nav *ICKNavbar) Item(key string) *ICKNavbarItem
Item returns the first item found with the given key, walking through all levels. returns nil if key is not found
func (*ICKNavbar) NeedRendering ¶
func (*ICKNavbar) RenderContent ¶
RenderContent writes the HTML string corresponding to the content of the HTML element.
func (*ICKNavbar) SetActiveItem ¶
SetActiveItem look for the key item (or subitem) and sets its IsActive flag. warning: does not unset other actve items if any.
type ICKNavbarItem ¶
type ICKNavbarItem struct {
Key string
// If Type is empty, NAVBARIT_START is used for rendering.
Type NAVBARITEM_TYPE
Content ickcore.ContentComposer
// If HRef is defined the item become an anchor link <a>, otherwise it's a <div>
// HRef can be nil. Usually it's created calling NavbarItem.TryParseHRef
HRef *url.URL
ImageSrc *url.URL // the url for the source of the image
IsActive bool
// contains filtered or unexported fields
}
ICKNavbarItem is an icecake snippet providing the HTML rendering for a bulma navbar item.
func (*ICKNavbarItem) AddItem ¶
func (navi *ICKNavbarItem) AddItem(key string, itmtyp NAVBARITEM_TYPE, content ickcore.ContentComposer) *ICKNavbarItem
AddItem adds the item as a subitem within the navbar item
func (*ICKNavbarItem) At ¶
func (navi *ICKNavbarItem) At(index int) *ICKNavbarItem
At returns the item at a given index. returns nil if index is out of range.
func (*ICKNavbarItem) BuildTag ¶
func (navi *ICKNavbarItem) BuildTag() ickcore.Tag
BuildTag builds the tag used to render the html element. The Navbar Item tag depends on the item properties:
- it's <hr> for a NAVBARIT_DIVIDER item type, otherwise
- it's <a> when an HRef is provided,
- it's <div> in other cases
func (ICKNavbarItem) Clone ¶
func (navi ICKNavbarItem) Clone() *ICKNavbarItem
Clone clones this navbar and all its items and subitem, keeping their attributes their item index and their key.
func (*ICKNavbarItem) Item ¶
func (navi *ICKNavbarItem) Item(key string) *ICKNavbarItem
Item returns the first item found with the given key, walking through all levels. returns nil if key is not found
func (*ICKNavbarItem) ParseHRef ¶
func (navi *ICKNavbarItem) ParseHRef(rawUrl string) *ICKNavbarItem
ParseHRef tries to parse rawUrl to HRef ignoring error.
func (*ICKNavbarItem) ParseImageSrc ¶
func (navi *ICKNavbarItem) ParseImageSrc(rawUrl string) *ICKNavbarItem
ParseImageSrc tries to parse rawUrl to image src ignoring error.
func (*ICKNavbarItem) RenderContent ¶
func (navi *ICKNavbarItem) RenderContent(out io.Writer) error
RenderContent writes the HTML string corresponding to the content of the HTML element.
func (*ICKNavbarItem) SetHRef ¶
func (navi *ICKNavbarItem) SetHRef(u url.URL) *ICKNavbarItem
func (*ICKNavbarItem) SetImageSrc ¶
func (navi *ICKNavbarItem) SetImageSrc(u url.URL) *ICKNavbarItem
type ICKSpinner ¶
type ICKSpinner struct {
ickcore.BareSnippet
}
func Spinner ¶
func Spinner() *ICKSpinner
func (*ICKSpinner) BuildTag ¶
func (spin *ICKSpinner) BuildTag() ickcore.Tag
Tag Builder used by the rendering functions.
func (*ICKSpinner) RenderContent ¶
func (*ICKSpinner) RenderContent(out io.Writer) error
RenderContent writes the ickcore string corresponding to the content of the ickcore element.
type ICKTagLabel ¶
type ICKTagLabel struct {
ickcore.BareSnippet
Header string // optional text to render on the left side of the taglabel
Text string // the tag text
CanDelete bool // set to true to display the delete button and allow user to delete the message
IsRounded bool
HeaderColor COLOR
TextColor COLOR
TAGLABEL_SIZE
// contains filtered or unexported fields
}
func (*ICKTagLabel) BuildTag ¶
func (t *ICKTagLabel) BuildTag() ickcore.Tag
BuildTag returns <span class="tag {classes}" {attributes}>
func (*ICKTagLabel) RenderContent ¶
func (t *ICKTagLabel) RenderContent(out io.Writer) error
RenderContent writes the HTML string corresponding to the content of the HTML element.
func (*ICKTagLabel) SetCanDelete ¶
func (t *ICKTagLabel) SetCanDelete(can bool) *ICKTagLabel
func (*ICKTagLabel) SetHeader ¶
func (t *ICKTagLabel) SetHeader(text string, c COLOR) *ICKTagLabel
func (*ICKTagLabel) SetRounded ¶
func (t *ICKTagLabel) SetRounded(f bool) *ICKTagLabel
func (*ICKTagLabel) SetSize ¶
func (t *ICKTagLabel) SetSize(s TAGLABEL_SIZE) *ICKTagLabel
SetSize set the size of the tag
type ICKTitle ¶
type ICKTitle struct {
ickcore.BareSnippet
Title string
// IsSubtitle allows to render the title with the class subtitle rather than title.
IsSubtitle bool
// Heading allows to render the title within a <h> tag, otherwise it's in a <p> tag.
Heading bool
// Size define the size of the title. Bounded between 1 and 6.
Size int
}
ICKTitle is an icecake snippet providing the HTML rendering for a bulma title. The title is an HTMLSnippet. Use AddContent to setup the content of the body of the title element.
type INPUT_STATE ¶
type INPUT_STATE string
const ( INPUT_STD INPUT_STATE = "" // the default input state INPUT_SUCCESS INPUT_STATE = "success" INPUT_WARNING INPUT_STATE = "warning" INPUT_ERROR INPUT_STATE = "error" INPUT_LOADING INPUT_STATE = "loading" INPUT_DISABLED INPUT_STATE = "disabled" INPUT_STATIC INPUT_STATE = "static" )
type IckMenuItem ¶
type IckMenuItem struct {
ickcore.BareSnippet
// Optional Key allows to access a specific navbaritem, whatever it's level in the hierarchy, directly from the navbar.
Key string
// The Item Type defines the location of the item in the navbar or if it's a simple divider.
// If Type is empty, NAVBARIT_START is used for rendering.
Type MENUITEM_TYPE
// Item Text
Text string
// HRef defines the optional associated url link.
// If HRef is defined the item become an anchor link <a>, otherwise it's a <div>
// HRef can be nil. Usually it's created calling MenuItem.ParseHRef
HRef *url.URL
// Highlight this item
IsActive bool
}
IckMenuItem is an icecake snippet providing the HTML rendering for a bulma navbar item.
Can't be used for inline rendering.
func (*IckMenuItem) BuildTag ¶
func (mnui *IckMenuItem) BuildTag() ickcore.Tag
BuildTag builds the tag used to render the html element.
func (IckMenuItem) Clone ¶
func (mnui IckMenuItem) Clone() *IckMenuItem
Clone clones this navbar and all its items and subitem, keeping their attributes their item index and their key.
func (*IckMenuItem) ParseHRef ¶
func (mnui *IckMenuItem) ParseHRef(rawUrl string) *IckMenuItem
ParseHRef tries to parse rawUrl to HRef ignoring error.
func (*IckMenuItem) RenderContent ¶
func (mnui *IckMenuItem) RenderContent(out io.Writer) error
RenderContent writes the HTML string corresponding to the content of the HTML element.
type MENUITEM_TYPE ¶
type MENUITEM_TYPE string
const ( MENUIT_LABEL MENUITEM_TYPE = "label" // informative label, a <p> tag at the top level MENUIT_LINK MENUITEM_TYPE = "link" // interactive menu item, a <li><a> tag at the 1st level MENUIT_NESTEDLINK MENUITEM_TYPE = "nested" // interactive menu item nested in a second level, a <li><a> tag at a 2nd level MENUIT_FOOTER MENUITEM_TYPE = "footer" // informative text, a <p> tag inserted in the foot of the menu )
type NAVBARITEM_TYPE ¶
type NAVBARITEM_TYPE string
const ( NAVBARIT_DIVIDER NAVBARITEM_TYPE = "divider" // creates a divider between two navbar items. other navbar properties are ignored. NAVBARIT_BRAND NAVBARITEM_TYPE = "brand" // item stacked in the brand area of the navbar. NAVBARIT_START NAVBARITEM_TYPE = "start" // item stacked at the start (left) of the navbar, this is the default behaviour NAVBARIT_END NAVBARITEM_TYPE = "end" // item stacked at the end (right) of the navbar, )
type Page ¶
type Page struct {
*WebSite
Lang string // the html "lang" value.
Title string // the html "head/title" value.
Description string // the html "head/meta description" value.
HeadItems []HeadItem // the list of tags in the section <head>
// contains filtered or unexported fields
}
An HTML5 file with its content.
func NewPage ¶
NewPage is the Page factory, seeting up the lang for the doctype tag, and the url of the page. Return nil if unable to parse the url of the page.
func (Page) AbsURL ¶
AbsURL returns the absolute URL of the page, excluding the query and the fragments if any.
func (*Page) AddHeadItem ¶
AddHeadItem add a line in the <head> section of the HtmlFile
func (*Page) Body ¶
Body returns the HTMLSnippet used to render the body tag. Attributes can be setup. The tag will be forced to body during rendering.
func (*Page) ParseURL ¶
ParseURL parses rawHTMLUrl to the URL of the page. The page URL stays nil in case of error. Only the relative path will be used. The path extention must be html or nothing, otherwise fails.
func (*Page) RMeta ¶
Meta provides a reference to the RenderingMeta object associated with this composer. This is required by the icecake rendering process.
func (Page) RelURL ¶
RelURL returns the relative URL of the page, excluding the query and the fragments if any.
func (*Page) RenderContent ¶
Render turns HtmlFile into a valid HTML syntax and write it to the output stream. Declared required CSS files and styles are automatically added.
func (*Page) WasmScript ¶
func (pg *Page) WasmScript() *ickcore.HTMLString
WasmScript returns the wasm script to be added ad the end of the page to enable loading of a wasm code
func (Page) WriteFile ¶
WriteHTMLFile creates or overwrites the file with htmlfilename name, adding the html extension if missing, and feeds it with the HtmlFile content including the header and the body. If path is provided, htmlfilename is joint to make an absolute path, otherwise htmlfilename is used in the current dir (unless it contains itself an absolute path). returns an error if ther's no filename
type TAGLABEL_SIZE ¶
type TAGLABEL_SIZE string
type WebSite ¶
type WebSite struct {
OutPath string // output path where generated websites files will be saved
WebURL *url.URL // website URL
// contains filtered or unexported fields
}
func NewWebSite ¶
func (*WebSite) CopyToAssets ¶
func (WebSite) ToAbsURLString ¶
func (WebSite) WriteFiles ¶
returns the number of pages written and errors.