compton

package module
v0.4.57 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2025 License: AGPL-3.0 Imports: 29 Imported by: 12

README

pages

Documentation

Index

Constants

View Source
const (
	RequirementsToken = ".Requirements"
	DeferralsToken    = ".Deferrals"
	ContentToken      = ".Content"
	AttributesToken   = ".Attributes"
)
View Source
const LinkTargetTop = "_top"

Variables

View Source
var (
	//go:embed "markup/*.html"
	DefaultMarkup embed.FS
	//go:embed "style/*.css"
	DefaultStyle embed.FS
)
View Source
var (
	Img      = Image
	ImgLazy  = ImageLazy
	ImgEager = ImageEager
)
View Source
var (
	P     = Paragraph
	PText = ParagraphText
)
View Source
var Br = Break

Functions

func ErrUnknownToken

func ErrUnknownToken(t string) error

func SpeculationRulesBytes added in v0.2.36

func SpeculationRulesBytes(eagerness SpeculationRulesEagerness, hrefMatches ...string) []byte

func WriteContents

func WriteContents(r io.Reader, w io.Writer, wd TokenWriter) error

Types

type Attributes

type Attributes struct {
	// contains filtered or unexported fields
}

func (*Attributes) GetAttribute added in v0.1.20

func (a *Attributes) GetAttribute(name string) string

func (*Attributes) SetAttribute added in v0.1.20

func (a *Attributes) SetAttribute(name, val string)

func (*Attributes) Write

func (a *Attributes) Write(w io.Writer) error

type BaseElement

type BaseElement struct {
	Attributes
	ClassList
	Children []Element
	TagName  atom.Atom
	MarkupProvider
}

func NewElement

func NewElement(a atom.Atom, mp MarkupProvider) *BaseElement

func (*BaseElement) Append

func (be *BaseElement) Append(children ...Element)

func (*BaseElement) GetElementById

func (be *BaseElement) GetElementById(id string) Element

func (*BaseElement) GetElementsByClassName

func (be *BaseElement) GetElementsByClassName(names ...string) []Element

func (*BaseElement) GetElementsByTagName

func (be *BaseElement) GetElementsByTagName(tagName atom.Atom) []Element

func (*BaseElement) GetFirstElementByTagName added in v0.1.80

func (be *BaseElement) GetFirstElementByTagName(tagName atom.Atom) Element

func (*BaseElement) GetTagName

func (be *BaseElement) GetTagName() atom.Atom

func (*BaseElement) HasChildren added in v0.1.61

func (be *BaseElement) HasChildren() bool

func (*BaseElement) SetId

func (be *BaseElement) SetId(id string)

func (*BaseElement) Write

func (be *BaseElement) Write(w io.Writer) error

func (*BaseElement) WriteFragment

func (be *BaseElement) WriteFragment(t string, w io.Writer) error

type CardElement added in v0.1.90

type CardElement struct {
	*BaseElement
	// contains filtered or unexported fields
}

func Card added in v0.1.90

func Card(r Registrar, id string) *CardElement

func (*CardElement) AppendBadges added in v0.2.98

func (ce *CardElement) AppendBadges(badges ...Element) *CardElement

func (*CardElement) AppendPoster added in v0.1.90

func (ce *CardElement) AppendPoster(background, placeholder, poster string, hydrated bool) *IssaImageElement

func (*CardElement) AppendProperty added in v0.1.90

func (ce *CardElement) AppendProperty(title string, values ...Element) Element

func (*CardElement) AppendTitle added in v0.1.90

func (ce *CardElement) AppendTitle(title string) *CardElement

func (*CardElement) Height added in v0.1.90

func (ce *CardElement) Height(s size.Size) *CardElement

func (*CardElement) HeightPixels added in v0.1.90

func (ce *CardElement) HeightPixels(px float64) *CardElement

func (*CardElement) Width added in v0.1.90

func (ce *CardElement) Width(s size.Size) *CardElement

func (*CardElement) WidthPixels added in v0.1.90

func (ce *CardElement) WidthPixels(px float64) *CardElement

type ClassList added in v0.1.20

type ClassList struct {
	// contains filtered or unexported fields
}

func (*ClassList) AddClass added in v0.1.20

func (cl *ClassList) AddClass(classes ...string)

func (*ClassList) HasClass added in v0.1.20

func (cl *ClassList) HasClass(classes ...string) bool

func (*ClassList) RemoveClass added in v0.1.20

func (cl *ClassList) RemoveClass(classes ...string)

func (*ClassList) String added in v0.1.20

func (cl *ClassList) String() string

func (*ClassList) ToggleClass added in v0.1.20

func (cl *ClassList) ToggleClass(classes ...string)

type CountFormatter added in v0.1.97

type CountFormatter struct {
	// contains filtered or unexported fields
}

func NewCountFormatter added in v0.1.97

func NewCountFormatter(single, manyInSingleSet, manyInManySets string) *CountFormatter

func (*CountFormatter) Title added in v0.1.97

func (cf *CountFormatter) Title(from, to, total int) string

func (*CountFormatter) TitleElement added in v0.1.97

func (cf *CountFormatter) TitleElement(r Registrar, from, to, total int) Element

type DetailsElement added in v0.1.84

type DetailsElement struct {
	*BaseElement
}

func Details added in v0.1.84

func Details() *DetailsElement

func (*DetailsElement) AppendSummary added in v0.1.84

func (d *DetailsElement) AppendSummary(children ...Element) *DetailsElement

func (*DetailsElement) Open added in v0.1.84

func (d *DetailsElement) Open() *DetailsElement

type DetailsSummaryElement added in v0.1.84

type DetailsSummaryElement struct {
	BaseElement
	// contains filtered or unexported fields
}

func DSLarge added in v0.1.84

func DSLarge(r Registrar, title string, open bool) *DetailsSummaryElement

func DSSmall added in v0.1.84

func DSSmall(r Registrar, title string, open bool) *DetailsSummaryElement

func (*DetailsSummaryElement) Append added in v0.1.84

func (dse *DetailsSummaryElement) Append(children ...Element)

func (*DetailsSummaryElement) AppendBadges added in v0.2.98

func (dse *DetailsSummaryElement) AppendBadges(badges ...Element)

func (*DetailsSummaryElement) BackgroundColor added in v0.1.84

func (dse *DetailsSummaryElement) BackgroundColor(c color.Color) *DetailsSummaryElement

func (*DetailsSummaryElement) DetailsMarginBlockEnd added in v0.1.84

func (dse *DetailsSummaryElement) DetailsMarginBlockEnd(s size.Size) *DetailsSummaryElement

func (*DetailsSummaryElement) ForegroundColor added in v0.1.84

func (dse *DetailsSummaryElement) ForegroundColor(c color.Color) *DetailsSummaryElement

func (*DetailsSummaryElement) MarkerColor added in v0.1.84

func (*DetailsSummaryElement) SetAccessKey added in v0.4.46

func (dse *DetailsSummaryElement) SetAccessKey(ak string)

func (*DetailsSummaryElement) SetId added in v0.1.84

func (dse *DetailsSummaryElement) SetId(id string)

func (*DetailsSummaryElement) SetTabIndex added in v0.2.41

func (dse *DetailsSummaryElement) SetTabIndex(index int)

func (*DetailsSummaryElement) SummaryAlignSelf added in v0.3.51

func (dse *DetailsSummaryElement) SummaryAlignSelf(a align.Align) *DetailsSummaryElement

func (*DetailsSummaryElement) SummaryJustifySelf added in v0.3.51

func (dse *DetailsSummaryElement) SummaryJustifySelf(a align.Align) *DetailsSummaryElement

func (*DetailsSummaryElement) SummaryMarginBlockEnd added in v0.1.84

func (dse *DetailsSummaryElement) SummaryMarginBlockEnd(s size.Size) *DetailsSummaryElement

func (*DetailsSummaryElement) SummaryOutlineColor added in v0.2.10

func (dse *DetailsSummaryElement) SummaryOutlineColor(c color.Color) *DetailsSummaryElement

func (*DetailsSummaryElement) SummaryOutlineColorHex added in v0.2.10

func (dse *DetailsSummaryElement) SummaryOutlineColorHex(hex string) *DetailsSummaryElement

func (*DetailsSummaryElement) SummaryRowGap added in v0.1.84

func (dse *DetailsSummaryElement) SummaryRowGap(s size.Size) *DetailsSummaryElement

func (*DetailsSummaryElement) Write added in v0.1.84

func (dse *DetailsSummaryElement) Write(w io.Writer) error

type Element

type Element interface {
	Append(children ...Element)
	HasChildren() bool

	Write(w io.Writer) error

	GetTagName() atom.Atom

	SetId(id string)

	AddClass(names ...string)
	RemoveClass(names ...string)
	HasClass(names ...string) bool
	ToggleClass(names ...string)

	SetAttribute(name, val string)
	GetAttribute(name string) string

	GetElementById(id string) Element
	GetElementsByTagName(tagName atom.Atom) []Element
	GetFirstElementByTagName(tagName atom.Atom) Element
	GetElementsByClassName(names ...string) []Element
}

func A added in v0.1.84

func A(href string) Element

func AText added in v0.1.84

func AText(txt, href string) Element

func AtomicElement added in v0.1.85

func AtomicElement(a atom.Atom) Element

func Badges added in v0.4.36

func Badges(r Registrar, badges ...FormattedBadge) Element

func Body added in v0.1.84

func Body() Element

func Break added in v0.1.84

func Break() Element

func Content added in v0.1.84

func Content() Element

func CopyToClipboard added in v0.4.7

func CopyToClipboard(r Registrar, cta, success, err Element, value string) Element

func Datalist added in v0.1.84

func Datalist(id string) Element

func Deferrals added in v0.1.84

func Deferrals() Element

func Dialog added in v0.3.51

func Dialog() Element

func Div added in v0.1.84

func Div() Element

func DivText added in v0.1.84

func DivText(txt string) Element

func Doctype added in v0.1.84

func Doctype() Element

func Document added in v0.1.84

func Document() Element

func Form added in v0.1.84

func Form(action, method string) Element

func H1 added in v0.1.84

func H1() Element

func H1Text added in v0.1.84

func H1Text(txt string) Element

func H2 added in v0.1.84

func H2() Element

func H2Text added in v0.1.84

func H2Text(txt string) Element

func H3 added in v0.1.84

func H3() Element

func H3Text added in v0.1.84

func H3Text(txt string) Element

func H4 added in v0.1.84

func H4() Element

func H4Text added in v0.1.84

func H4Text(txt string) Element

func H5 added in v0.1.84

func H5() Element

func H5Text added in v0.1.84

func H5Text(txt string) Element

func H6 added in v0.1.84

func H6() Element

func H6Text added in v0.1.84

func H6Text(txt string) Element
func Head() Element

func Heading added in v0.1.84

func Heading(level int) Element

func HeadingText added in v0.1.84

func HeadingText(txt string, level int) Element

func HorizontalRule added in v0.1.84

func HorizontalRule() Element

func Html added in v0.1.84

func Html(lang string) Element

func Iframe added in v0.1.84

func Iframe(src string) Element

func IframeEager added in v0.3.46

func IframeEager(src string) Element

func IframeExpandHost added in v0.1.84

func IframeExpandHost(r Registrar, id, src string, eagerness loading.Loading) Element

IframeExpandHost creates iframe-expand that will expand height to content height. In order to achieve that, two scripts need to be present script/receive.js on the host page (the page that contains iframe element) script/post.js within the iframe page. See NewContent that creates the page with that script. Initially host iframe has opacity: 0 through `loading` class to avoid flash of white content as iframe loads

func IframeLazy added in v0.1.84

func IframeLazy(src string) Element

func Image added in v0.1.84

func Image(src string) Element

func ImageEager added in v0.1.84

func ImageEager(src string) Element

func ImageLazy added in v0.1.84

func ImageLazy(src string) Element

func Label added in v0.1.84

func Label(forInput string) Element

func LineBreakOpportunity added in v0.3.22

func LineBreakOpportunity() Element
func Link(kv map[string]string) Element

func ListItem added in v0.1.84

func ListItem() Element

func ListItemText added in v0.1.84

func ListItemText(txt string) Element

func Meta added in v0.1.84

func Meta(kv map[string]string) Element

func MonthDay added in v0.4.49

func MonthDay(r Registrar, month time.Month, day int) Element

func Option added in v0.1.84

func Option(value, label string) Element

func OrderedList added in v0.1.84

func OrderedList() Element

func Paragraph added in v0.2.20

func Paragraph() Element

func ParagraphText added in v0.2.20

func ParagraphText(txt string) Element

func Placeholder added in v0.1.90

func Placeholder() Element

func Pre added in v0.2.21

func Pre() Element

func PreText added in v0.2.21

func PreText(txt string) Element

func Requirements added in v0.1.84

func Requirements() Element

func Section added in v0.1.84

func Section() Element

func SectionDivider added in v0.3.12

func SectionDivider(r Registrar, fmtBadge FormattedBadge) Element
func SectionsLinks(r Registrar, sections []string, sectionTitles map[string]string) Element

func Span added in v0.1.84

func Span() Element

func SpanText added in v0.1.84

func SpanText(txt string) Element

func Style added in v0.1.84

func Style(styles []byte) Element

func Summary added in v0.1.84

func Summary() Element

func Tbody added in v0.1.84

func Tbody() Element

func Td added in v0.1.84

func Td() Element

func Text added in v0.1.84

func Text(content string) Element

func Tfoot added in v0.1.84

func Tfoot() Element

func Th added in v0.1.84

func Th() Element

func Thead added in v0.1.84

func Thead() Element

func Time added in v0.1.84

func Time() Element

func TimeText added in v0.1.84

func TimeText(txt string) Element

func Title added in v0.1.84

func Title(txt string) Element

func Tr added in v0.1.84

func Tr() Element

func UnorderedList added in v0.1.84

func UnorderedList() Element

func Video added in v0.1.84

func Video(src string) Element

type EncapsulationMode

type EncapsulationMode string
const (
	EncapsulationOpen   EncapsulationMode = "open"
	EncapsulationClosed EncapsulationMode = "closed"
)

type FlexItemsElement added in v0.1.84

type FlexItemsElement struct {
	*BaseElement
}

func FICenter added in v0.1.84

func FICenter(r Registrar, elements ...Element) *FlexItemsElement

func FlexItems added in v0.1.84

func (*FlexItemsElement) AlignContent added in v0.1.84

func (fie *FlexItemsElement) AlignContent(a align.Align) *FlexItemsElement

func (*FlexItemsElement) AlignItems added in v0.1.84

func (fie *FlexItemsElement) AlignItems(a align.Align) *FlexItemsElement

func (*FlexItemsElement) BackgroundColor added in v0.1.84

func (fie *FlexItemsElement) BackgroundColor(c color.Color) *FlexItemsElement

func (*FlexItemsElement) BorderRadius added in v0.3.12

func (fie *FlexItemsElement) BorderRadius(s size.Size) *FlexItemsElement

func (*FlexItemsElement) ColumnGap added in v0.1.84

func (fie *FlexItemsElement) ColumnGap(sz size.Size) *FlexItemsElement

func (*FlexItemsElement) ColumnWidthRule added in v0.3.46

func (fie *FlexItemsElement) ColumnWidthRule(s size.Size) *FlexItemsElement

func (*FlexItemsElement) FlexWrap added in v0.4.35

func (fie *FlexItemsElement) FlexWrap(fw wrap.FlexWrap) *FlexItemsElement

func (*FlexItemsElement) FontSize added in v0.1.84

func (fie *FlexItemsElement) FontSize(s size.Size) *FlexItemsElement

func (*FlexItemsElement) FontWeight added in v0.1.84

func (*FlexItemsElement) ForegroundColor added in v0.1.84

func (fie *FlexItemsElement) ForegroundColor(c color.Color) *FlexItemsElement

func (*FlexItemsElement) Gap added in v0.1.84

func (*FlexItemsElement) Height added in v0.4.49

func (fie *FlexItemsElement) Height(s size.Size) *FlexItemsElement

func (*FlexItemsElement) JustifyContent added in v0.1.84

func (fie *FlexItemsElement) JustifyContent(a align.Align) *FlexItemsElement

func (*FlexItemsElement) JustifyItems added in v0.1.84

func (fie *FlexItemsElement) JustifyItems(a align.Align) *FlexItemsElement

func (*FlexItemsElement) MaxWidth added in v0.3.12

func (fie *FlexItemsElement) MaxWidth(s size.Size) *FlexItemsElement

func (*FlexItemsElement) RowGap added in v0.1.84

func (fie *FlexItemsElement) RowGap(sz size.Size) *FlexItemsElement

func (*FlexItemsElement) Width added in v0.3.12

func (fie *FlexItemsElement) Width(s size.Size) *FlexItemsElement

type FormattedBadge added in v0.2.98

type FormattedBadge struct {
	Title string
	Icon  Symbol
	Color color.Color
}

type FrowElement added in v0.1.86

type FrowElement struct {
	*BaseElement
	// contains filtered or unexported fields
}

func Frow added in v0.1.86

func Frow(r Registrar) *FrowElement

func (*FrowElement) BackgroundColor added in v0.4.40

func (f *FrowElement) BackgroundColor(c color.Color) *FrowElement

func (*FrowElement) Elements added in v0.2.3

func (f *FrowElement) Elements(elements ...Element) *FrowElement

func (*FrowElement) FontSize added in v0.2.22

func (f *FrowElement) FontSize(s size.Size) *FrowElement

func (*FrowElement) Heading added in v0.1.86

func (f *FrowElement) Heading(title string) Element

func (*FrowElement) Highlight added in v0.1.86

func (f *FrowElement) Highlight(title string) Element

func (*FrowElement) IconColor added in v0.1.86

func (f *FrowElement) IconColor(symbol Symbol, c color.Color) Element

func (*FrowElement) LinkColor added in v0.2.23

func (f *FrowElement) LinkColor(title, href string, c color.Color) Element

func (*FrowElement) LinkVal added in v0.4.44

func (f *FrowElement) LinkVal(title, href string, vals ...string) Element

func (*FrowElement) PropIcons added in v0.2.19

func (f *FrowElement) PropIcons(p string, symbols ...Symbol) Element

func (*FrowElement) PropLinkColor added in v0.3.58

func (f *FrowElement) PropLinkColor(p string, c color.Color, title, href string) Element

func (*FrowElement) PropVal added in v0.1.86

func (f *FrowElement) PropVal(p string, vals ...string) Element

func (*FrowElement) Width added in v0.4.40

func (f *FrowElement) Width(s size.Size) *FrowElement

type FspanElement added in v0.1.84

type FspanElement struct {
	*BaseElement
}

func Fspan added in v0.1.84

func Fspan(r Registrar, t string) *FspanElement

func (*FspanElement) BackgroundColor added in v0.1.84

func (fse *FspanElement) BackgroundColor(c color.Color) *FspanElement

func (*FspanElement) BorderRadius added in v0.2.37

func (fse *FspanElement) BorderRadius(s size.Size) *FspanElement

func (*FspanElement) FontSize added in v0.1.84

func (fse *FspanElement) FontSize(s size.Size) *FspanElement

func (*FspanElement) FontWeight added in v0.1.84

func (fse *FspanElement) FontWeight(w font_weight.Weight) *FspanElement

func (*FspanElement) ForegroundColor added in v0.1.84

func (fse *FspanElement) ForegroundColor(c color.Color) *FspanElement

func (*FspanElement) LineHeight added in v0.3.54

func (fse *FspanElement) LineHeight(s size.Size) *FspanElement

func (*FspanElement) MaxWidth added in v0.3.12

func (fse *FspanElement) MaxWidth(s size.Size) *FspanElement

func (*FspanElement) Padding added in v0.2.37

func (fse *FspanElement) Padding(s size.Size) *FspanElement

func (*FspanElement) PaddingBlock added in v0.2.37

func (fse *FspanElement) PaddingBlock(s size.Size) *FspanElement

func (*FspanElement) PaddingInline added in v0.2.37

func (fse *FspanElement) PaddingInline(s size.Size) *FspanElement

func (*FspanElement) SetTextContent added in v0.2.51

func (fse *FspanElement) SetTextContent(text string) *FspanElement

func (*FspanElement) TextAlign added in v0.2.2

func (fse *FspanElement) TextAlign(a align.Align) *FspanElement

func (*FspanElement) Width added in v0.3.12

func (fse *FspanElement) Width(s size.Size) *FspanElement

type IframeExpandElement added in v0.1.84

type IframeExpandElement struct {
	BaseElement
	// contains filtered or unexported fields
}

func (*IframeExpandElement) Write added in v0.1.84

func (ife *IframeExpandElement) Write(w io.Writer) error

type InputElement added in v0.1.84

type InputElement struct {
	*BaseElement
	// contains filtered or unexported fields
}

func Input added in v0.1.84

func Input(r Registrar, it input_types.Type) *InputElement

func InputValue added in v0.1.84

func InputValue(r Registrar, it input_types.Type, value string) *InputElement

func Switch added in v0.1.84

func Switch(r Registrar) *InputElement

func (*InputElement) FontWeight added in v0.1.84

func (ie *InputElement) FontWeight(w font_weight.Weight) *InputElement

func (*InputElement) SetChecked added in v0.1.84

func (ie *InputElement) SetChecked(condition bool) *InputElement

func (*InputElement) SetDatalist added in v0.1.84

func (ie *InputElement) SetDatalist(list map[string]string, listId string) *InputElement

func (*InputElement) SetDisabled added in v0.1.84

func (ie *InputElement) SetDisabled(condition bool) *InputElement

func (*InputElement) SetName added in v0.1.84

func (ie *InputElement) SetName(name string) *InputElement

func (*InputElement) SetPlaceholder added in v0.1.84

func (ie *InputElement) SetPlaceholder(placeholder string) *InputElement

func (*InputElement) SetValue added in v0.1.84

func (ie *InputElement) SetValue(value string) *InputElement

type IssaImageElement added in v0.1.84

type IssaImageElement struct {
	*BaseElement
	// contains filtered or unexported fields
}

func IssaImageDehydrated added in v0.1.84

func IssaImageDehydrated(r Registrar, bgHex, placeholder, poster string) *IssaImageElement

func IssaImageHydrated added in v0.1.84

func IssaImageHydrated(r Registrar, bgHex, placeholder, poster string) *IssaImageElement

func IssaImageWrapper added in v0.2.59

func IssaImageWrapper(r Registrar, poster string) *IssaImageElement

func (*IssaImageElement) AspectRatio added in v0.2.16

func (iie *IssaImageElement) AspectRatio(ar float64) *IssaImageElement

func (*IssaImageElement) Height added in v0.1.89

func (iie *IssaImageElement) Height(s size.Size) *IssaImageElement

func (*IssaImageElement) HeightPixels added in v0.1.89

func (iie *IssaImageElement) HeightPixels(px float64) *IssaImageElement

func (*IssaImageElement) Width added in v0.1.89

func (iie *IssaImageElement) Width(s size.Size) *IssaImageElement

func (*IssaImageElement) WidthPixels added in v0.1.89

func (iie *IssaImageElement) WidthPixels(px float64) *IssaImageElement

type MarkupProvider added in v0.1.85

type MarkupProvider interface {
	GetMarkup() ([]byte, error)
}

func BytesMarkup added in v0.1.85

func BytesMarkup(a atom.Atom, bts []byte) (atom.Atom, MarkupProvider)
type NavLinksElement struct {
	*BaseElement
}
func NavLinks(r Registrar) *NavLinksElement
func (nle *NavLinksElement) AppendLink(r Registrar, target *NavTarget) Element
func (nle *NavLinksElement) AppendSubmitLink(r Registrar, target *NavTarget) Element
func (nle *NavLinksElement) Width(s size.Size) *NavLinksElement
type NavTarget struct {
	Href  string
	Title string
	//Symbol   Symbol
	IconElement Element
	Selected    bool
}

type PageElement added in v0.1.83

type PageElement interface {
	Element
	Registrar

	Error(err error) PageElement

	SetBodyId(id string) PageElement
	SetBodyAttribute(name, val string)

	AppendManifest() PageElement
	AppendIcon() PageElement
	AppendSpeculationRules(eagerness SpeculationRulesEagerness, hrefMatches ...string)

	WriteResponse(w http.ResponseWriter) error
}

func IframeExpandContent added in v0.1.84

func IframeExpandContent(id, title string) PageElement

IframeExpandContent creates an iframe content page and attaches script/post.js that send the message on iframe content size change to the host page that contains script/receive.js to size host iframe element and remove `loading` class

func Page added in v0.1.84

func Page(title string) PageElement

type Registrar

type Registrar interface {
	RegisterStyles(efs embed.FS, names ...string)
	RegisterRequirements(name string, elements ...Element)
	RegisterDeferrals(name string, elements ...Element)
}

type ScriptElement added in v0.1.84

type ScriptElement struct {
	*BaseElement
	// contains filtered or unexported fields
}

func Script added in v0.1.84

func Script(code []byte) *ScriptElement

func ScriptAsync added in v0.1.84

func ScriptAsync(code []byte) *ScriptElement

func (*ScriptElement) Sha256 added in v0.1.84

func (se *ScriptElement) Sha256() string

type SpeculationRules added in v0.2.36

type SpeculationRules struct {
	Prerender []SpeculationRulesPrerender `json:"prerender"`
}

type SpeculationRulesEagerness added in v0.3.59

type SpeculationRulesEagerness int
const (
	SpeculationRulesImmediateEagerness SpeculationRulesEagerness = iota
	SpeculationRulesEagerEagerness
	SpeculationRulesModerateEagerness
	SpeculationRulesConservativeEagerness
)

type SpeculationRulesPrerender added in v0.2.36

type SpeculationRulesPrerender struct {
	Source string `json:"source"`
	Where  struct {
		And []*UriMatch `json:"and"`
	} `json:"where"`
	Eagerness string `json:"eagerness"`
}

type StyleElement added in v0.3.35

type StyleElement struct {
	*BaseElement
	// contains filtered or unexported fields
}

func (*StyleElement) Sha256 added in v0.3.35

func (se *StyleElement) Sha256() string

type SvgUseElement added in v0.1.84

type SvgUseElement struct {
	*BaseElement
	// contains filtered or unexported fields
}

func SvgUse added in v0.1.84

func SvgUse(r Registrar, s Symbol) *SvgUseElement

func (*SvgUseElement) ForegroundColor added in v0.1.86

func (sue *SvgUseElement) ForegroundColor(c color.Color) *SvgUseElement

func (*SvgUseElement) Write added in v0.1.84

func (sue *SvgUseElement) Write(w io.Writer) error

func (*SvgUseElement) WriteFragment added in v0.1.85

func (sue *SvgUseElement) WriteFragment(t string, w io.Writer) error

type Symbol added in v0.1.84

type Symbol int
const (
	NoSymbol Symbol = iota
	Windows
	PlaceOfInterest
	SteamDeck
	Sparkle
	Search
	CirclePositive
	TriangleNeutral
	CrossNegative
	UpwardChevron
	RightwardChevron
	DownwardChevron
	LeftwardChevron
	ThreeDownwardChevrons
	ThreeUpwardChevrons
	ThreeHorizontalLines
	CircleCompactDisk
	CircleDashed
	CircleClockArrows
	CircleDownwardArrow
	NewsBroadcast
	ShoppingLabel
	Bookmark
	Percent
	Heart
	Shield
	PuzzlePiece
	TwoTitleValues
	Gemstone
	ItemsPack
	ItemPlus
	Trophy
	HexagonDiagonalLines
	HexagonClockArrows
	HexagonDownwardArrow
	HexagonSparkling
	VideoThumbnail
	ImageThumbnail
	ExternalLink
	Today
)

type TableElement added in v0.1.84

type TableElement struct {
	*BaseElement
	// contains filtered or unexported fields
}

func Table added in v0.1.84

func Table(r Registrar) *TableElement

func (*TableElement) AppendFoot added in v0.1.84

func (te *TableElement) AppendFoot(columns ...string) *TableElement

func (*TableElement) AppendHead added in v0.1.84

func (te *TableElement) AppendHead(columns ...string) *TableElement

func (*TableElement) AppendRow added in v0.1.84

func (te *TableElement) AppendRow(data ...string) *TableElement

type TextElement added in v0.1.84

type TextElement struct {
	*BaseElement
	// contains filtered or unexported fields
}

func (*TextElement) Append added in v0.1.84

func (t *TextElement) Append(_ ...Element)

func (*TextElement) Write added in v0.1.84

func (t *TextElement) Write(w io.Writer) error

type TitleInputElement added in v0.1.84

type TitleInputElement struct {
	*TitleValuesElement
	// contains filtered or unexported fields
}

func TIPassword added in v0.4.12

func TIPassword(r Registrar, title, inputId string) *TitleInputElement

func TISearch added in v0.1.84

func TISearch(r Registrar, title, inputId string) *TitleInputElement

func TISearchValue added in v0.1.84

func TISearchValue(wcr Registrar, title, inputId, value string) *TitleInputElement

func TIText added in v0.4.12

func TIText(r Registrar, title, inputId string) *TitleInputElement

func (*TitleInputElement) SetDatalist added in v0.1.84

func (ti *TitleInputElement) SetDatalist(list map[string]string, listId string) *TitleInputElement

type TitleValuesElement added in v0.1.84

type TitleValuesElement struct {
	*BaseElement
	// contains filtered or unexported fields
}

func TitleValues added in v0.1.84

func TitleValues(r Registrar, title string) *TitleValuesElement

func (*TitleValuesElement) Append added in v0.3.70

func (tve *TitleValuesElement) Append(elements ...Element)

func (*TitleValuesElement) AppendLinkValues added in v0.1.84

func (tve *TitleValuesElement) AppendLinkValues(limit int, links map[string]string, order ...string) *TitleValuesElement

func (*TitleValuesElement) ForegroundColor added in v0.1.84

func (tve *TitleValuesElement) ForegroundColor(c color.Color) *TitleValuesElement

func (*TitleValuesElement) MaxWidth added in v0.4.13

func (tve *TitleValuesElement) MaxWidth(s size.Size) *TitleValuesElement

func (*TitleValuesElement) RowGap added in v0.1.84

func (*TitleValuesElement) SetLinksTarget added in v0.2.1

func (tve *TitleValuesElement) SetLinksTarget(target string) *TitleValuesElement

func (*TitleValuesElement) TitleForegroundColor added in v0.1.84

func (tve *TitleValuesElement) TitleForegroundColor(c color.Color) *TitleValuesElement

func (*TitleValuesElement) Width added in v0.4.13

func (*TitleValuesElement) Write added in v0.1.84

func (tve *TitleValuesElement) Write(w io.Writer) error

type TokenWriter

type TokenWriter func(token string, w io.Writer) error

type UriMatch added in v0.2.36

type UriMatch struct {
	HrefMatches     string    `json:"href_matches,omitempty"`
	SelectorMatches string    `json:"selector_matches,omitempty"`
	Not             *UriMatch `json:"not,omitempty"`
}

Directories

Path Synopsis
consts

Jump to

Keyboard shortcuts

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