Documentation
¶
Overview ¶
Package html5 holds the cross-element machinery that the per-element packages under html5/ build on. It is generated from the HTML5 specification YAML and exports three families of declarations:
The byte-slice Tag, Markup, and Attr constants in constants.go are internal rendering primitives used by every element's RenderOpen and RenderClose to avoid string-to-byte conversions when writing into a bytes.Buffer. They are exported so that extensions and custom elements can reuse the same write path, not as a way to set attributes - use the typed methods on each element (.Class, .Href, .Checked, ...) or github.com/jpl-au/fluent/node.Element.SetAttribute for that.
GlobalAttributes embeds the attributes available on every HTML element (style, title, lang, role, ARIA, popover, ...). Each per-element struct embeds it.
EventAttributes embeds the on* event handler attributes available on every HTML element (onclick, onchange, ...).
Application code rarely imports html5 directly - reach for the per-element packages (html5/div, html5/input, html5/a, ...) and the typed attribute packages under html5/attr instead.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( MarkupDoctype = []byte(`<!DOCTYPE html>`) MarkupSpace = []byte(` `) MarkupQuote = []byte(`"`) MarkupEquals = []byte(`=`) MarkupCloseTag = []byte(`>`) MarkupSelfCloseTag = []byte(` />`) )
Utility constants are the byte fragments shared across every element's RenderOpen and RenderClose: the doctype, the spaces and quotes that delimit attributes, and the terminators that close a tag. They are exported so extensions building custom elements can reuse the same allocation-free write path. To set an attribute in user code, use the typed methods on the element (.Class, .Href, .Checked, ...) or, for custom keys, node.Element.SetAttribute - not these constants.
var ( TagA = []byte(`<a`) TagAbbr = []byte(`<abbr`) TagAddress = []byte(`<address`) TagArea = []byte(`<area`) TagArticle = []byte(`<article`) TagAside = []byte(`<aside`) TagAudio = []byte(`<audio`) TagB = []byte(`<b`) TagBase = []byte(`<base`) TagBdi = []byte(`<bdi`) TagBdo = []byte(`<bdo`) TagBlockquote = []byte(`<blockquote`) TagBody = []byte(`<body`) TagBr = []byte(`<br`) TagButton = []byte(`<button`) TagCanvas = []byte(`<canvas`) TagCaption = []byte(`<caption`) TagCite = []byte(`<cite`) TagCode = []byte(`<code`) TagCol = []byte(`<col`) TagColgroup = []byte(`<colgroup`) TagData = []byte(`<data`) TagDatalist = []byte(`<datalist`) TagDd = []byte(`<dd`) TagDel = []byte(`<del`) TagDetails = []byte(`<details`) TagDfn = []byte(`<dfn`) TagDialog = []byte(`<dialog`) TagDiv = []byte(`<div`) TagDl = []byte(`<dl`) TagDt = []byte(`<dt`) TagEm = []byte(`<em`) TagEmbed = []byte(`<embed`) TagFieldset = []byte(`<fieldset`) TagFigcaption = []byte(`<figcaption`) TagFigure = []byte(`<figure`) TagForm = []byte(`<form`) TagH1 = []byte(`<h1`) TagH2 = []byte(`<h2`) TagH3 = []byte(`<h3`) TagH4 = []byte(`<h4`) TagH5 = []byte(`<h5`) TagH6 = []byte(`<h6`) TagHead = []byte(`<head`) TagHeader = []byte(`<header`) TagHgroup = []byte(`<hgroup`) TagHr = []byte(`<hr`) TagHtml = []byte(`<html`) TagI = []byte(`<i`) TagIframe = []byte(`<iframe`) TagImg = []byte(`<img`) TagInput = []byte(`<input`) TagIns = []byte(`<ins`) TagKbd = []byte(`<kbd`) TagLabel = []byte(`<label`) TagLegend = []byte(`<legend`) TagLi = []byte(`<li`) TagLink = []byte(`<link`) TagMain = []byte(`<main`) TagMap = []byte(`<map`) TagMark = []byte(`<mark`) TagMath = []byte(`<math`) TagMenu = []byte(`<menu`) TagMeta = []byte(`<meta`) TagMeter = []byte(`<meter`) TagNoscript = []byte(`<noscript`) TagObject = []byte(`<object`) TagOl = []byte(`<ol`) TagOptgroup = []byte(`<optgroup`) TagOption = []byte(`<option`) TagOutput = []byte(`<output`) TagP = []byte(`<p`) TagPicture = []byte(`<picture`) TagPre = []byte(`<pre`) TagProgress = []byte(`<progress`) TagQ = []byte(`<q`) TagRp = []byte(`<rp`) TagRt = []byte(`<rt`) TagRuby = []byte(`<ruby`) TagS = []byte(`<s`) TagSamp = []byte(`<samp`) TagScript = []byte(`<script`) TagSearch = []byte(`<search`) TagSection = []byte(`<section`) TagSelect = []byte(`<select`) TagSlot = []byte(`<slot`) TagSmall = []byte(`<small`) TagSource = []byte(`<source`) TagSpan = []byte(`<span`) TagStrong = []byte(`<strong`) TagStyle = []byte(`<style`) TagSub = []byte(`<sub`) TagSummary = []byte(`<summary`) TagSup = []byte(`<sup`) TagSvg = []byte(`<svg`) TagTable = []byte(`<table`) TagTbody = []byte(`<tbody`) TagTd = []byte(`<td`) TagTemplate = []byte(`<template`) TagTextarea = []byte(`<textarea`) TagTfoot = []byte(`<tfoot`) TagTh = []byte(`<th`) TagThead = []byte(`<thead`) TagTime = []byte(`<time`) TagTitle = []byte(`<title`) TagTr = []byte(`<tr`) TagTrack = []byte(`<track`) TagU = []byte(`<u`) TagUl = []byte(`<ul`) TagVar = []byte(`<var`) TagVideo = []byte(`<video`) TagWbr = []byte(`<wbr`) )
Tag opening constants are the leading bytes of each element's open tag - the < followed by the element name, with no trailing space or > so that AttributeBuilder can append attributes directly. Used by every element's RenderOpen.
var ( TagAClose = []byte(`</a>`) TagAbbrClose = []byte(`</abbr>`) TagAddressClose = []byte(`</address>`) TagArticleClose = []byte(`</article>`) TagAsideClose = []byte(`</aside>`) TagAudioClose = []byte(`</audio>`) TagBClose = []byte(`</b>`) TagBdiClose = []byte(`</bdi>`) TagBdoClose = []byte(`</bdo>`) TagBlockquoteClose = []byte(`</blockquote>`) TagBodyClose = []byte(`</body>`) TagButtonClose = []byte(`</button>`) TagCanvasClose = []byte(`</canvas>`) TagCaptionClose = []byte(`</caption>`) TagCiteClose = []byte(`</cite>`) TagCodeClose = []byte(`</code>`) TagColgroupClose = []byte(`</colgroup>`) TagDataClose = []byte(`</data>`) TagDatalistClose = []byte(`</datalist>`) TagDdClose = []byte(`</dd>`) TagDelClose = []byte(`</del>`) TagDetailsClose = []byte(`</details>`) TagDfnClose = []byte(`</dfn>`) TagDialogClose = []byte(`</dialog>`) TagDivClose = []byte(`</div>`) TagDlClose = []byte(`</dl>`) TagDtClose = []byte(`</dt>`) TagEmClose = []byte(`</em>`) TagFieldsetClose = []byte(`</fieldset>`) TagFigcaptionClose = []byte(`</figcaption>`) TagFigureClose = []byte(`</figure>`) TagFormClose = []byte(`</form>`) TagH1Close = []byte(`</h1>`) TagH2Close = []byte(`</h2>`) TagH3Close = []byte(`</h3>`) TagH4Close = []byte(`</h4>`) TagH5Close = []byte(`</h5>`) TagH6Close = []byte(`</h6>`) TagHeadClose = []byte(`</head>`) TagHeaderClose = []byte(`</header>`) TagHgroupClose = []byte(`</hgroup>`) TagHtmlClose = []byte(`</html>`) TagIClose = []byte(`</i>`) TagIframeClose = []byte(`</iframe>`) TagInsClose = []byte(`</ins>`) TagKbdClose = []byte(`</kbd>`) TagLabelClose = []byte(`</label>`) TagLegendClose = []byte(`</legend>`) TagLiClose = []byte(`</li>`) TagMainClose = []byte(`</main>`) TagMapClose = []byte(`</map>`) TagMarkClose = []byte(`</mark>`) TagMathClose = []byte(`</math>`) TagMenuClose = []byte(`</menu>`) TagMeterClose = []byte(`</meter>`) TagNoscriptClose = []byte(`</noscript>`) TagObjectClose = []byte(`</object>`) TagOlClose = []byte(`</ol>`) TagOptgroupClose = []byte(`</optgroup>`) TagOptionClose = []byte(`</option>`) TagOutputClose = []byte(`</output>`) TagPClose = []byte(`</p>`) TagPictureClose = []byte(`</picture>`) TagPreClose = []byte(`</pre>`) TagProgressClose = []byte(`</progress>`) TagQClose = []byte(`</q>`) TagRpClose = []byte(`</rp>`) TagRtClose = []byte(`</rt>`) TagRubyClose = []byte(`</ruby>`) TagSClose = []byte(`</s>`) TagSampClose = []byte(`</samp>`) TagScriptClose = []byte(`</script>`) TagSearchClose = []byte(`</search>`) TagSectionClose = []byte(`</section>`) TagSelectClose = []byte(`</select>`) TagSlotClose = []byte(`</slot>`) TagSmallClose = []byte(`</small>`) TagSpanClose = []byte(`</span>`) TagStrongClose = []byte(`</strong>`) TagStyleClose = []byte(`</style>`) TagSubClose = []byte(`</sub>`) TagSummaryClose = []byte(`</summary>`) TagSupClose = []byte(`</sup>`) TagSvgClose = []byte(`</svg>`) TagTableClose = []byte(`</table>`) TagTbodyClose = []byte(`</tbody>`) TagTdClose = []byte(`</td>`) TagTemplateClose = []byte(`</template>`) TagTextareaClose = []byte(`</textarea>`) TagTfootClose = []byte(`</tfoot>`) TagThClose = []byte(`</th>`) TagTheadClose = []byte(`</thead>`) TagTimeClose = []byte(`</time>`) TagTitleClose = []byte(`</title>`) TagTrClose = []byte(`</tr>`) TagUClose = []byte(`</u>`) TagUlClose = []byte(`</ul>`) TagVarClose = []byte(`</var>`) TagVideoClose = []byte(`</video>`) )
Tag closing constants are the complete closing tags for every non-void element. Used by every element's RenderClose.
var ( AttrClass = []byte(` class="`) AttrID = []byte(` id="`) AttrStyle = []byte(` style="`) AttrTitle = []byte(` title="`) AttrHidden = []byte(` hidden="`) AttrTabIndex = []byte(` tabindex="`) AttrRole = []byte(` role="`) AttrLang = []byte(` lang="`) AttrAccessKey = []byte(` accesskey="`) AttrAnchor = []byte(` anchor="`) AttrAriaLabel = []byte(` aria-label="`) AttrAutoCapitalize = []byte(` autocapitalize="`) AttrAutoCorrect = []byte(` autocorrect="`) AttrContentEditable = []byte(` contenteditable="`) AttrDir = []byte(` dir="`) AttrEnterKeyHint = []byte(` enterkeyhint="`) AttrExportParts = []byte(` exportparts="`) AttrInputMode = []byte(` inputmode="`) AttrIs = []byte(` is="`) AttrItemId = []byte(` itemid="`) AttrItemProp = []byte(` itemprop="`) AttrItemRef = []byte(` itemref="`) AttrItemType = []byte(` itemtype="`) AttrNonce = []byte(` nonce="`) AttrPart = []byte(` part="`) AttrPopover = []byte(` popover="`) AttrSlot = []byte(` slot="`) AttrSpellCheck = []byte(` spellcheck="`) AttrTranslate = []byte(` translate="`) AttrVirtualKeyboardPolicy = []byte(` virtualkeyboardpolicy="`) AttrWritingSuggestions = []byte(` writingsuggestions="`) AttrOnClick = []byte(` onclick="`) AttrOnChange = []byte(` onchange="`) AttrOnInput = []byte(` oninput="`) AttrOnFocus = []byte(` onfocus="`) AttrOnBlur = []byte(` onblur="`) AttrOnSubmit = []byte(` onsubmit="`) AttrOnLoad = []byte(` onload="`) AttrOnError = []byte(` onerror="`) AttrOnAbort = []byte(` onabort="`) AttrOnAutoComplete = []byte(` onautocomplete="`) AttrOnAutoCompleteError = []byte(` onautocompleteerror="`) AttrOnCancel = []byte(` oncancel="`) AttrOnCanPlay = []byte(` oncanplay="`) AttrOnCanPlayThrough = []byte(` oncanplaythrough="`) AttrOnClose = []byte(` onclose="`) AttrOnContextMenu = []byte(` oncontextmenu="`) AttrOnCueChange = []byte(` oncuechange="`) AttrOnDblClick = []byte(` ondblclick="`) AttrOnDrag = []byte(` ondrag="`) AttrOnDragEnd = []byte(` ondragend="`) AttrOnDragEnter = []byte(` ondragenter="`) AttrOnDragLeave = []byte(` ondragleave="`) AttrOnDragOver = []byte(` ondragover="`) AttrOnDragStart = []byte(` ondragstart="`) AttrOnDrop = []byte(` ondrop="`) AttrOnDurationChange = []byte(` ondurationchange="`) AttrOnEmptied = []byte(` onemptied="`) AttrOnEnded = []byte(` onended="`) AttrOnInvalid = []byte(` oninvalid="`) AttrOnKeyDown = []byte(` onkeydown="`) AttrOnKeyPress = []byte(` onkeypress="`) AttrOnKeyUp = []byte(` onkeyup="`) AttrOnLoadedData = []byte(` onloadeddata="`) AttrOnLoadedMetadata = []byte(` onloadedmetadata="`) AttrOnLoadStart = []byte(` onloadstart="`) AttrOnMouseDown = []byte(` onmousedown="`) AttrOnMouseEnter = []byte(` onmouseenter="`) AttrOnMouseLeave = []byte(` onmouseleave="`) AttrOnMouseMove = []byte(` onmousemove="`) AttrOnMouseOut = []byte(` onmouseout="`) AttrOnMouseOver = []byte(` onmouseover="`) AttrOnMouseUp = []byte(` onmouseup="`) AttrOnMouseWheel = []byte(` onmousewheel="`) AttrOnPause = []byte(` onpause="`) AttrOnPlay = []byte(` onplay="`) AttrOnPlaying = []byte(` onplaying="`) AttrOnProgress = []byte(` onprogress="`) AttrOnRateChange = []byte(` onratechange="`) AttrOnReset = []byte(` onreset="`) AttrOnResize = []byte(` onresize="`) AttrOnScroll = []byte(` onscroll="`) AttrOnSeeked = []byte(` onseeked="`) AttrOnSeeking = []byte(` onseeking="`) AttrOnSelect = []byte(` onselect="`) AttrOnShow = []byte(` onshow="`) AttrOnSort = []byte(` onsort="`) AttrOnStalled = []byte(` onstalled="`) AttrOnSuspend = []byte(` onsuspend="`) AttrOnTimeUpdate = []byte(` ontimeupdate="`) AttrOnToggle = []byte(` ontoggle="`) AttrOnVolumeChange = []byte(` onvolumechange="`) AttrOnWaiting = []byte(` onwaiting="`) AttrOnAuxClick = []byte(` onauxclick="`) AttrOnWheel = []byte(` onwheel="`) AttrOnCopy = []byte(` oncopy="`) AttrOnCut = []byte(` oncut="`) AttrOnPaste = []byte(` onpaste="`) AttrOnScrollEnd = []byte(` onscrollend="`) AttrOnFormData = []byte(` onformdata="`) AttrOnAnimationCancel = []byte(` onanimationcancel="`) AttrOnAnimationEnd = []byte(` onanimationend="`) AttrOnAnimationIteration = []byte(` onanimationiteration="`) AttrOnAnimationStart = []byte(` onanimationstart="`) AttrOnTransitionCancel = []byte(` ontransitioncancel="`) AttrOnTransitionEnd = []byte(` ontransitionend="`) AttrOnTransitionRun = []byte(` ontransitionrun="`) AttrOnTransitionStart = []byte(` ontransitionstart="`) AttrOnBeforeToggle = []byte(` onbeforetoggle="`) AttrOnBeforeInput = []byte(` onbeforeinput="`) AttrOnBeforeMatch = []byte(` onbeforematch="`) AttrOnCommand = []byte(` oncommand="`) AttrOnContextLost = []byte(` oncontextlost="`) AttrOnContextRestored = []byte(` oncontextrestored="`) AttrOnSecurityPolicyViolation = []byte(` onsecuritypolicyviolation="`) AttrOnSlotChange = []byte(` onslotchange="`) AttrOnPointerDown = []byte(` onpointerdown="`) AttrOnPointerUp = []byte(` onpointerup="`) AttrOnPointerMove = []byte(` onpointermove="`) AttrOnPointerEnter = []byte(` onpointerenter="`) AttrOnPointerLeave = []byte(` onpointerleave="`) AttrOnPointerOver = []byte(` onpointerover="`) AttrOnPointerOut = []byte(` onpointerout="`) AttrOnPointerCancel = []byte(` onpointercancel="`) AttrOnGotPointerCapture = []byte(` ongotpointercapture="`) AttrOnLostPointerCapture = []byte(` onlostpointercapture="`) AttrOnTouchStart = []byte(` ontouchstart="`) AttrOnTouchEnd = []byte(` ontouchend="`) AttrOnTouchMove = []byte(` ontouchmove="`) AttrOnTouchCancel = []byte(` ontouchcancel="`) AttrOnSelectStart = []byte(` onselectstart="`) AttrOnSelectionChange = []byte(` onselectionchange="`) AttrHref = []byte(` href="`) AttrAttributionSrc = []byte(` attributionsrc="`) AttrDownload = []byte(` download="`) AttrHrefLang = []byte(` hreflang="`) AttrPing = []byte(` ping="`) AttrReferrerPolicy = []byte(` referrerpolicy="`) AttrRel = []byte(` rel="`) AttrTarget = []byte(` target="`) AttrType = []byte(` type="`) AttrShape = []byte(` shape="`) AttrCoords = []byte(` coords="`) AttrAlt = []byte(` alt="`) AttrSrc = []byte(` src="`) AttrControlsList = []byte(` controlslist="`) AttrCrossOrigin = []byte(` crossorigin="`) AttrLoading = []byte(` loading="`) AttrPreload = []byte(` preload="`) AttrCite = []byte(` cite="`) AttrCommand = []byte(` command="`) AttrCommandfor = []byte(` commandfor="`) AttrForm = []byte(` form="`) AttrFormaction = []byte(` formaction="`) AttrFormenctype = []byte(` formenctype="`) AttrFormmethod = []byte(` formmethod="`) AttrFormtarget = []byte(` formtarget="`) AttrName = []byte(` name="`) AttrPopOverTarget = []byte(` popovertarget="`) AttrPopovertargetaction = []byte(` popovertargetaction="`) AttrValue = []byte(` value="`) AttrHeight = []byte(` height="`) AttrWidth = []byte(` width="`) AttrSpan = []byte(` span="`) AttrDateTime = []byte(` datetime="`) AttrClosedBy = []byte(` closedby="`) AttrAction = []byte(` action="`) AttrMethod = []byte(` method="`) AttrAcceptCharset = []byte(` accept-charset="`) AttrAutoComplete = []byte(` autocomplete="`) AttrEncType = []byte(` enctype="`) AttrProfile = []byte(` profile="`) AttrXmlns = []byte(` xmlns="`) AttrManifest = []byte(` manifest="`) AttrAllow = []byte(` allow="`) AttrSandbox = []byte(` sandbox="`) AttrSrcDoc = []byte(` srcdoc="`) AttrCsp = []byte(` csp="`) AttrSizes = []byte(` sizes="`) AttrSrcset = []byte(` srcset="`) AttrDecoding = []byte(` decoding="`) AttrFetchPriority = []byte(` fetchpriority="`) AttrUseMap = []byte(` usemap="`) AttrElementTiming = []byte(` elementtiming="`) AttrAccept = []byte(` accept="`) AttrCapture = []byte(` capture="`) AttrDirName = []byte(` dirname="`) AttrFormAction = []byte(` formaction="`) AttrFormEncType = []byte(` formenctype="`) AttrFormMethod = []byte(` formmethod="`) AttrFormTarget = []byte(` formtarget="`) AttrList = []byte(` list="`) AttrMax = []byte(` max="`) AttrMaxLength = []byte(` maxlength="`) AttrMin = []byte(` min="`) AttrMinLength = []byte(` minlength="`) AttrPattern = []byte(` pattern="`) AttrPlaceholder = []byte(` placeholder="`) AttrPopoverTarget = []byte(` popovertarget="`) AttrPopoverTargetAction = []byte(` popovertargetaction="`) AttrSize = []byte(` size="`) AttrStep = []byte(` step="`) AttrColorSpace = []byte(` colorspace="`) AttrFor = []byte(` for="`) AttrAs = []byte(` as="`) AttrIntegrity = []byte(` integrity="`) AttrMedia = []byte(` media="`) AttrBlocking = []byte(` blocking="`) AttrImageSrcset = []byte(` imagesrcset="`) AttrImageSizes = []byte(` imagesizes="`) AttrColor = []byte(` color="`) AttrDisplay = []byte(` display="`) AttrMathVariant = []byte(` mathvariant="`) AttrContent = []byte(` content="`) AttrCharset = []byte(` charset="`) AttrHttpEquiv = []byte(` http-equiv="`) AttrScheme = []byte(` scheme="`) AttrProperty = []byte(` property="`) AttrLow = []byte(` low="`) AttrHigh = []byte(` high="`) AttrOptimum = []byte(` optimum="`) AttrData = []byte(` data="`) AttrStart = []byte(` start="`) AttrLabel = []byte(` label="`) AttrViewBox = []byte(` viewbox="`) AttrPreserveAspectRatio = []byte(` preserveaspectratio="`) AttrBorder = []byte(` border="`) AttrCellPadding = []byte(` cellpadding="`) AttrCellSpacing = []byte(` cellspacing="`) AttrFrame = []byte(` frame="`) AttrRules = []byte(` rules="`) AttrSummary = []byte(` summary="`) AttrColSpan = []byte(` colspan="`) AttrRowSpan = []byte(` rowspan="`) AttrHeaders = []byte(` headers="`) AttrShadowRootMode = []byte(` shadowrootmode="`) AttrRows = []byte(` rows="`) AttrCols = []byte(` cols="`) AttrWrap = []byte(` wrap="`) AttrScope = []byte(` scope="`) AttrAbbr = []byte(` abbr="`) AttrAlign = []byte(` align="`) AttrBgColor = []byte(` bgcolor="`) AttrChar = []byte(` char="`) AttrCharOff = []byte(` charoff="`) AttrVAlign = []byte(` valign="`) AttrKind = []byte(` kind="`) AttrSrclang = []byte(` srclang="`) AttrPoster = []byte(` poster="`) )
Attribute name constants are the leading bytes of each attribute fragment - a leading space, the attribute name, the equals sign, and the opening quote (e.g. ` class="`) - so the renderer can append the value and closing quote without further allocation. Used by AttributeBuilder on every element.
var ( AttrAutoFocus = []byte(` autofocus`) AttrDraggable = []byte(` draggable`) AttrInert = []byte(` inert`) AttrItemScope = []byte(` itemscope`) AttrAutoplay = []byte(` autoplay`) AttrControls = []byte(` controls`) AttrLoop = []byte(` loop`) AttrMuted = []byte(` muted`) AttrDisableRemotePlayback = []byte(` disableremoteplayback`) AttrDisabled = []byte(` disabled`) AttrFormnovalidate = []byte(` formnovalidate`) AttrOpen = []byte(` open`) AttrNoValidate = []byte(` novalidate`) AttrAllowFullscreen = []byte(` allowfullscreen`) AttrCredentialless = []byte(` credentialless`) AttrIsMap = []byte(` ismap`) AttrChecked = []byte(` checked`) AttrFormNoValidate = []byte(` formnovalidate`) AttrMultiple = []byte(` multiple`) AttrReadOnly = []byte(` readonly`) AttrRequired = []byte(` required`) AttrAlpha = []byte(` alpha`) AttrReversed = []byte(` reversed`) AttrSelected = []byte(` selected`) AttrAsync = []byte(` async`) AttrDefer = []byte(` defer`) AttrNoModule = []byte(` nomodule`) AttrShadowRootClonable = []byte(` shadowrootclonable`) AttrShadowRootDelegatesFocus = []byte(` shadowrootdelegatesfocus`) AttrShadowRootSerializable = []byte(` shadowrootserializable`) AttrDefault = []byte(` default`) AttrDisablePictureInPicture = []byte(` disablepictureinpicture`) AttrPlaysInline = []byte(` playsinline`) )
Boolean attribute constants are the complete fragments emitted for HTML boolean attributes when set - typically a leading space followed by the attribute name (e.g. ` checked`). The renderer writes them verbatim, with no value or quoting.
Functions ¶
This section is empty.
Types ¶
type EventAttributes ¶
type EventAttributes struct {
OnClick string
OnChange string
OnInput string
OnFocus string
OnBlur string
OnSubmit string
OnKeyDown string
OnKeyUp string
// contains filtered or unexported fields
}
EventAttributes holds the event HTML attributes that every element supports. It is embedded into every generated element struct so the typed fields below are reachable on the element directly. The unexported attr slice backs the generic key-value store written by SetAttribute for keys that have no typed field.
func (*EventAttributes) AttributeBuilder ¶
func (ea *EventAttributes) AttributeBuilder(buf *bytes.Buffer)
AttributeBuilder writes every set event attribute - both the typed fields and any custom keys added via SetAttribute - directly into buf using the pre-allocated byte constants from the html5 package. Called by each element's RenderOpen between the tag-open prefix and the closing > so attributes appear in the rendered tag.
func (*EventAttributes) Attributes ¶
func (ea *EventAttributes) Attributes() *[]node.Attribute
Attributes returns a pointer to the underlying generic-attribute slice - the same slice SetAttribute writes into. The pointer is nil until SetAttribute has been called at least once. Intended for extensions and tooling that need to inspect or mutate the custom attributes set on an element; application code should rarely need it.
func (*EventAttributes) SetAttribute ¶
func (ea *EventAttributes) SetAttribute(key string, value string)
SetAttribute is the escape hatch for attributes that the typed API does not cover - framework directives like Alpine.js (x-on:click) or HTMX (hx-get), and any other custom or non-standard attribute. For everything else, prefer the typed methods on the element (.Class, .Href, .Checked, ...) or, for ARIA and data-* attributes, SetAria and SetData. Repeated calls with the same key overwrite the existing value rather than appending a duplicate. The method returns nothing on purpose: it cannot be chained, which keeps the Fluent API the obvious default.
type GlobalAttributes ¶
type GlobalAttributes struct {
Style string
Title string
Role string
Lang string
AccessKey string
AriaLabel string
AutoCapitalize autocapitalize.AutoCapitalize
AutoCorrect autocorrect.AutoCorrect
ContentEditable contenteditable.ContentEditable
Dir dir.Dir
EnterKeyHint enterkeyhint.EnterKeyHint
ExportParts string
InputMode inputmode.InputMode
ItemProp string
ItemRef string
Part string
Popover popover.Popover
SpellCheck spellcheck.Spellcheck
Translate translate.Translate
VirtualKeyboardPolicy virtualkeyboardpolicy.VirtualKeyboardPolicy
WritingSuggestions writingsuggestions.WritingSuggestions
// contains filtered or unexported fields
}
GlobalAttributes holds the global HTML attributes that every element supports. It is embedded into every generated element struct so the typed fields below are reachable on the element directly. The unexported attr slice backs the generic key-value store written by SetAttribute for keys that have no typed field.
func (*GlobalAttributes) AttributeBuilder ¶
func (ga *GlobalAttributes) AttributeBuilder(buf *bytes.Buffer)
AttributeBuilder writes every set global attribute - both the typed fields and any custom keys added via SetAttribute - directly into buf using the pre-allocated byte constants from the html5 package. Called by each element's RenderOpen between the tag-open prefix and the closing > so attributes appear in the rendered tag.
func (*GlobalAttributes) Attributes ¶
func (ga *GlobalAttributes) Attributes() *[]node.Attribute
Attributes returns a pointer to the underlying generic-attribute slice - the same slice SetAttribute writes into. The pointer is nil until SetAttribute has been called at least once. Intended for extensions and tooling that need to inspect or mutate the custom attributes set on an element; application code should rarely need it.
func (*GlobalAttributes) SetAttribute ¶
func (ga *GlobalAttributes) SetAttribute(key string, value string)
SetAttribute is the escape hatch for attributes that the typed API does not cover - framework directives like Alpine.js (x-on:click) or HTMX (hx-get), and any other custom or non-standard attribute. For everything else, prefer the typed methods on the element (.Class, .Href, .Checked, ...) or, for ARIA and data-* attributes, SetAria and SetData. Repeated calls with the same key overwrite the existing value rather than appending a duplicate. The method returns nothing on purpose: it cannot be chained, which keeps the Fluent API the obvious default.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package a provides constructors and methods for the HTML <a> element.
|
Package a provides constructors and methods for the HTML <a> element. |
|
Package abbr provides constructors and methods for the HTML <abbr> element.
|
Package abbr provides constructors and methods for the HTML <abbr> element. |
|
Package address provides constructors and methods for the HTML <address> element.
|
Package address provides constructors and methods for the HTML <address> element. |
|
Package area provides constructors and methods for the HTML <area> element.
|
Package area provides constructors and methods for the HTML <area> element. |
|
Package article provides constructors and methods for the HTML <article> element.
|
Package article provides constructors and methods for the HTML <article> element. |
|
Package aside provides constructors and methods for the HTML <aside> element.
|
Package aside provides constructors and methods for the HTML <aside> element. |
|
attr
|
|
|
accept
Package accept defines the Accept type and its predefined values.
|
Package accept defines the Accept type and its predefined values. |
|
as
Package as defines the As type and its predefined values.
|
Package as defines the As type and its predefined values. |
|
autocapitalize
Package autocapitalize defines the AutoCapitalize type and its predefined values.
|
Package autocapitalize defines the AutoCapitalize type and its predefined values. |
|
autocomplete
Package autocomplete defines the AutoComplete type and its predefined values.
|
Package autocomplete defines the AutoComplete type and its predefined values. |
|
autocorrect
Package autocorrect defines the AutoCorrect type and its predefined values.
|
Package autocorrect defines the AutoCorrect type and its predefined values. |
|
blocking
Package blocking defines the Blocking type and its predefined values.
|
Package blocking defines the Blocking type and its predefined values. |
|
capture
Package capture defines the Capture type and its predefined values.
|
Package capture defines the Capture type and its predefined values. |
|
charset
Package charset defines the Charset type and its predefined values.
|
Package charset defines the Charset type and its predefined values. |
|
contenteditable
Package contenteditable defines the ContentEditable type and its predefined values.
|
Package contenteditable defines the ContentEditable type and its predefined values. |
|
controlslist
Package controlslist defines the ControlsList type and its predefined values.
|
Package controlslist defines the ControlsList type and its predefined values. |
|
crossorigin
Package crossorigin defines the CrossOrigin type and its predefined values.
|
Package crossorigin defines the CrossOrigin type and its predefined values. |
|
decoding
Package decoding defines the Decoding type and its predefined values.
|
Package decoding defines the Decoding type and its predefined values. |
|
dir
Package dir defines the Dir type and its predefined values.
|
Package dir defines the Dir type and its predefined values. |
|
enctype
Package enctype defines the EncType type and its predefined values.
|
Package enctype defines the EncType type and its predefined values. |
|
enterkeyhint
Package enterkeyhint defines the EnterKeyHint type and its predefined values.
|
Package enterkeyhint defines the EnterKeyHint type and its predefined values. |
|
fetchpriority
Package fetchpriority defines the FetchPriority type and its predefined values.
|
Package fetchpriority defines the FetchPriority type and its predefined values. |
|
formmethod
Package formmethod defines the FormMethod type and its predefined values.
|
Package formmethod defines the FormMethod type and its predefined values. |
|
hidden
Package hidden defines the Hidden type and its predefined values.
|
Package hidden defines the Hidden type and its predefined values. |
|
inputmode
Package inputmode defines the InputMode type and its predefined values.
|
Package inputmode defines the InputMode type and its predefined values. |
|
inputtype
Package inputtype defines the InputType type and its predefined values.
|
Package inputtype defines the InputType type and its predefined values. |
|
listtype
Package listtype defines the ListType type and its predefined values.
|
Package listtype defines the ListType type and its predefined values. |
|
loading
Package loading defines the Loading type and its predefined values.
|
Package loading defines the Loading type and its predefined values. |
|
media
Package media defines the Media type and its predefined values.
|
Package media defines the Media type and its predefined values. |
|
method
Package method defines the Method type and its predefined values.
|
Package method defines the Method type and its predefined values. |
|
popover
Package popover defines the Popover type and its predefined values.
|
Package popover defines the Popover type and its predefined values. |
|
popovertargetaction
Package popovertargetaction defines the PopoverTargetAction type and its predefined values.
|
Package popovertargetaction defines the PopoverTargetAction type and its predefined values. |
|
preload
Package preload defines the Preload type and its predefined values.
|
Package preload defines the Preload type and its predefined values. |
|
referrerpolicy
Package referrerpolicy defines the ReferrerPolicy type and its predefined values.
|
Package referrerpolicy defines the ReferrerPolicy type and its predefined values. |
|
rel
Package rel defines the Rel type and its predefined values.
|
Package rel defines the Rel type and its predefined values. |
|
sandbox
Package sandbox defines the Sandbox type and its predefined values.
|
Package sandbox defines the Sandbox type and its predefined values. |
|
shape
Package shape defines the Shape type and its predefined values.
|
Package shape defines the Shape type and its predefined values. |
|
sizes
Package sizes defines the Size type and its predefined values.
|
Package sizes defines the Size type and its predefined values. |
|
spellcheck
Package spellcheck defines the Spellcheck type and its predefined values.
|
Package spellcheck defines the Spellcheck type and its predefined values. |
|
target
Package target defines the Target type and its predefined values.
|
Package target defines the Target type and its predefined values. |
|
translate
Package translate defines the Translate type and its predefined values.
|
Package translate defines the Translate type and its predefined values. |
|
virtualkeyboardpolicy
Package virtualkeyboardpolicy defines the VirtualKeyboardPolicy type and its predefined values.
|
Package virtualkeyboardpolicy defines the VirtualKeyboardPolicy type and its predefined values. |
|
writingsuggestions
Package writingsuggestions defines the WritingSuggestions type and its predefined values.
|
Package writingsuggestions defines the WritingSuggestions type and its predefined values. |
|
Package audio provides constructors and methods for the HTML <audio> element.
|
Package audio provides constructors and methods for the HTML <audio> element. |
|
Package b provides constructors and methods for the HTML <b> element.
|
Package b provides constructors and methods for the HTML <b> element. |
|
Package base provides constructors and methods for the HTML <base> element.
|
Package base provides constructors and methods for the HTML <base> element. |
|
Package bdi provides constructors and methods for the HTML <bdi> element.
|
Package bdi provides constructors and methods for the HTML <bdi> element. |
|
Package bdo provides constructors and methods for the HTML <bdo> element.
|
Package bdo provides constructors and methods for the HTML <bdo> element. |
|
Package blockquote provides constructors and methods for the HTML <blockquote> element.
|
Package blockquote provides constructors and methods for the HTML <blockquote> element. |
|
Package body provides constructors and methods for the HTML <body> element.
|
Package body provides constructors and methods for the HTML <body> element. |
|
Package br provides constructors and methods for the HTML <br> element.
|
Package br provides constructors and methods for the HTML <br> element. |
|
Package button provides constructors and methods for the HTML <button> element.
|
Package button provides constructors and methods for the HTML <button> element. |
|
Package canvas provides constructors and methods for the HTML <canvas> element.
|
Package canvas provides constructors and methods for the HTML <canvas> element. |
|
Package caption provides constructors and methods for the HTML <caption> element.
|
Package caption provides constructors and methods for the HTML <caption> element. |
|
Package cite provides constructors and methods for the HTML <cite> element.
|
Package cite provides constructors and methods for the HTML <cite> element. |
|
Package code provides constructors and methods for the HTML <code> element.
|
Package code provides constructors and methods for the HTML <code> element. |
|
Package col provides constructors and methods for the HTML <col> element.
|
Package col provides constructors and methods for the HTML <col> element. |
|
Package colgroup provides constructors and methods for the HTML <colgroup> element.
|
Package colgroup provides constructors and methods for the HTML <colgroup> element. |
|
Package data provides constructors and methods for the HTML <data> element.
|
Package data provides constructors and methods for the HTML <data> element. |
|
Package datalist provides constructors and methods for the HTML <datalist> element.
|
Package datalist provides constructors and methods for the HTML <datalist> element. |
|
Package dd provides constructors and methods for the HTML <dd> element.
|
Package dd provides constructors and methods for the HTML <dd> element. |
|
Package del provides constructors and methods for the HTML <del> element.
|
Package del provides constructors and methods for the HTML <del> element. |
|
Package details provides constructors and methods for the HTML <details> element.
|
Package details provides constructors and methods for the HTML <details> element. |
|
Package dfn provides constructors and methods for the HTML <dfn> element.
|
Package dfn provides constructors and methods for the HTML <dfn> element. |
|
Package dialog provides constructors and methods for the HTML <dialog> element.
|
Package dialog provides constructors and methods for the HTML <dialog> element. |
|
Package div provides constructors and methods for the HTML <div> element.
|
Package div provides constructors and methods for the HTML <div> element. |
|
Package dl provides constructors and methods for the HTML <dl> element.
|
Package dl provides constructors and methods for the HTML <dl> element. |
|
Package dropdown provides constructors and methods for the HTML <select> element.
|
Package dropdown provides constructors and methods for the HTML <select> element. |
|
Package dt provides constructors and methods for the HTML <dt> element.
|
Package dt provides constructors and methods for the HTML <dt> element. |
|
Package em provides constructors and methods for the HTML <em> element.
|
Package em provides constructors and methods for the HTML <em> element. |
|
Package embed provides constructors and methods for the HTML <embed> element.
|
Package embed provides constructors and methods for the HTML <embed> element. |
|
Package fieldset provides constructors and methods for the HTML <fieldset> element.
|
Package fieldset provides constructors and methods for the HTML <fieldset> element. |
|
Package figcaption provides constructors and methods for the HTML <figcaption> element.
|
Package figcaption provides constructors and methods for the HTML <figcaption> element. |
|
Package figure provides constructors and methods for the HTML <figure> element.
|
Package figure provides constructors and methods for the HTML <figure> element. |
|
Package footer provides constructors and methods for the HTML <footer> element.
|
Package footer provides constructors and methods for the HTML <footer> element. |
|
Package form provides constructors and methods for the HTML <form> element.
|
Package form provides constructors and methods for the HTML <form> element. |
|
Package h1 provides constructors and methods for the HTML <h1> element.
|
Package h1 provides constructors and methods for the HTML <h1> element. |
|
Package h2 provides constructors and methods for the HTML <h2> element.
|
Package h2 provides constructors and methods for the HTML <h2> element. |
|
Package h3 provides constructors and methods for the HTML <h3> element.
|
Package h3 provides constructors and methods for the HTML <h3> element. |
|
Package h4 provides constructors and methods for the HTML <h4> element.
|
Package h4 provides constructors and methods for the HTML <h4> element. |
|
Package h5 provides constructors and methods for the HTML <h5> element.
|
Package h5 provides constructors and methods for the HTML <h5> element. |
|
Package h6 provides constructors and methods for the HTML <h6> element.
|
Package h6 provides constructors and methods for the HTML <h6> element. |
|
Package head provides constructors and methods for the HTML <head> element.
|
Package head provides constructors and methods for the HTML <head> element. |
|
Package header provides constructors and methods for the HTML <header> element.
|
Package header provides constructors and methods for the HTML <header> element. |
|
Package hgroup provides constructors and methods for the HTML <hgroup> element.
|
Package hgroup provides constructors and methods for the HTML <hgroup> element. |
|
Package hr provides constructors and methods for the HTML <hr> element.
|
Package hr provides constructors and methods for the HTML <hr> element. |
|
Package html provides constructors and methods for the HTML <html> element.
|
Package html provides constructors and methods for the HTML <html> element. |
|
Package i provides constructors and methods for the HTML <i> element.
|
Package i provides constructors and methods for the HTML <i> element. |
|
Package iframe provides constructors and methods for the HTML <iframe> element.
|
Package iframe provides constructors and methods for the HTML <iframe> element. |
|
Package imagemap provides constructors and methods for the HTML <map> element.
|
Package imagemap provides constructors and methods for the HTML <map> element. |
|
Package img provides constructors and methods for the HTML <img> element.
|
Package img provides constructors and methods for the HTML <img> element. |
|
Package input provides constructors and methods for the HTML <input> element.
|
Package input provides constructors and methods for the HTML <input> element. |
|
Package ins provides constructors and methods for the HTML <ins> element.
|
Package ins provides constructors and methods for the HTML <ins> element. |
|
Package kbd provides constructors and methods for the HTML <kbd> element.
|
Package kbd provides constructors and methods for the HTML <kbd> element. |
|
Package label provides constructors and methods for the HTML <label> element.
|
Package label provides constructors and methods for the HTML <label> element. |
|
Package legend provides constructors and methods for the HTML <legend> element.
|
Package legend provides constructors and methods for the HTML <legend> element. |
|
Package li provides constructors and methods for the HTML <li> element.
|
Package li provides constructors and methods for the HTML <li> element. |
|
Package link provides constructors and methods for the HTML <link> element.
|
Package link provides constructors and methods for the HTML <link> element. |
|
Package mark provides constructors and methods for the HTML <mark> element.
|
Package mark provides constructors and methods for the HTML <mark> element. |
|
Package math provides constructors and methods for the HTML <math> element.
|
Package math provides constructors and methods for the HTML <math> element. |
|
Package menu provides constructors and methods for the HTML <menu> element.
|
Package menu provides constructors and methods for the HTML <menu> element. |
|
Package meta provides constructors and methods for the HTML <meta> element.
|
Package meta provides constructors and methods for the HTML <meta> element. |
|
Package meter provides constructors and methods for the HTML <meter> element.
|
Package meter provides constructors and methods for the HTML <meter> element. |
|
Package nav provides constructors and methods for the HTML <nav> element.
|
Package nav provides constructors and methods for the HTML <nav> element. |
|
Package noscript provides constructors and methods for the HTML <noscript> element.
|
Package noscript provides constructors and methods for the HTML <noscript> element. |
|
Package object provides constructors and methods for the HTML <object> element.
|
Package object provides constructors and methods for the HTML <object> element. |
|
Package ol provides constructors and methods for the HTML <ol> element.
|
Package ol provides constructors and methods for the HTML <ol> element. |
|
Package optgroup provides constructors and methods for the HTML <optgroup> element.
|
Package optgroup provides constructors and methods for the HTML <optgroup> element. |
|
Package option provides constructors and methods for the HTML <option> element.
|
Package option provides constructors and methods for the HTML <option> element. |
|
Package output provides constructors and methods for the HTML <output> element.
|
Package output provides constructors and methods for the HTML <output> element. |
|
Package p provides constructors and methods for the HTML <p> element.
|
Package p provides constructors and methods for the HTML <p> element. |
|
Package picture provides constructors and methods for the HTML <picture> element.
|
Package picture provides constructors and methods for the HTML <picture> element. |
|
Package pre provides constructors and methods for the HTML <pre> element.
|
Package pre provides constructors and methods for the HTML <pre> element. |
|
Package primary provides constructors and methods for the HTML <main> element.
|
Package primary provides constructors and methods for the HTML <main> element. |
|
Package progress provides constructors and methods for the HTML <progress> element.
|
Package progress provides constructors and methods for the HTML <progress> element. |
|
Package q provides constructors and methods for the HTML <q> element.
|
Package q provides constructors and methods for the HTML <q> element. |
|
Package rp provides constructors and methods for the HTML <rp> element.
|
Package rp provides constructors and methods for the HTML <rp> element. |
|
Package rt provides constructors and methods for the HTML <rt> element.
|
Package rt provides constructors and methods for the HTML <rt> element. |
|
Package ruby provides constructors and methods for the HTML <ruby> element.
|
Package ruby provides constructors and methods for the HTML <ruby> element. |
|
Package s provides constructors and methods for the HTML <s> element.
|
Package s provides constructors and methods for the HTML <s> element. |
|
Package samp provides constructors and methods for the HTML <samp> element.
|
Package samp provides constructors and methods for the HTML <samp> element. |
|
Package script provides constructors and methods for the HTML <script> element.
|
Package script provides constructors and methods for the HTML <script> element. |
|
Package search provides constructors and methods for the HTML <search> element.
|
Package search provides constructors and methods for the HTML <search> element. |
|
Package section provides constructors and methods for the HTML <section> element.
|
Package section provides constructors and methods for the HTML <section> element. |
|
Package slot provides constructors and methods for the HTML <slot> element.
|
Package slot provides constructors and methods for the HTML <slot> element. |
|
Package small provides constructors and methods for the HTML <small> element.
|
Package small provides constructors and methods for the HTML <small> element. |
|
Package source provides constructors and methods for the HTML <source> element.
|
Package source provides constructors and methods for the HTML <source> element. |
|
Package span provides constructors and methods for the HTML <span> element.
|
Package span provides constructors and methods for the HTML <span> element. |
|
Package strong provides constructors and methods for the HTML <strong> element.
|
Package strong provides constructors and methods for the HTML <strong> element. |
|
Package style provides constructors and methods for the HTML <style> element.
|
Package style provides constructors and methods for the HTML <style> element. |
|
Package sub provides constructors and methods for the HTML <sub> element.
|
Package sub provides constructors and methods for the HTML <sub> element. |
|
Package summary provides constructors and methods for the HTML <summary> element.
|
Package summary provides constructors and methods for the HTML <summary> element. |
|
Package sup provides constructors and methods for the HTML <sup> element.
|
Package sup provides constructors and methods for the HTML <sup> element. |
|
Package svg provides constructors and methods for the HTML <svg> element.
|
Package svg provides constructors and methods for the HTML <svg> element. |
|
Package table provides constructors and methods for the HTML <table> element.
|
Package table provides constructors and methods for the HTML <table> element. |
|
Package tbody provides constructors and methods for the HTML <tbody> element.
|
Package tbody provides constructors and methods for the HTML <tbody> element. |
|
Package td provides constructors and methods for the HTML <td> element.
|
Package td provides constructors and methods for the HTML <td> element. |
|
Package template provides constructors and methods for the HTML <template> element.
|
Package template provides constructors and methods for the HTML <template> element. |
|
Package textarea provides constructors and methods for the HTML <textarea> element.
|
Package textarea provides constructors and methods for the HTML <textarea> element. |
|
Package tfoot provides constructors and methods for the HTML <tfoot> element.
|
Package tfoot provides constructors and methods for the HTML <tfoot> element. |
|
Package th provides constructors and methods for the HTML <th> element.
|
Package th provides constructors and methods for the HTML <th> element. |
|
Package thead provides constructors and methods for the HTML <thead> element.
|
Package thead provides constructors and methods for the HTML <thead> element. |
|
Package time provides constructors and methods for the HTML <time> element.
|
Package time provides constructors and methods for the HTML <time> element. |
|
Package title provides constructors and methods for the HTML <title> element.
|
Package title provides constructors and methods for the HTML <title> element. |
|
Package tr provides constructors and methods for the HTML <tr> element.
|
Package tr provides constructors and methods for the HTML <tr> element. |
|
Package track provides constructors and methods for the HTML <track> element.
|
Package track provides constructors and methods for the HTML <track> element. |
|
Package u provides constructors and methods for the HTML <u> element.
|
Package u provides constructors and methods for the HTML <u> element. |
|
Package ul provides constructors and methods for the HTML <ul> element.
|
Package ul provides constructors and methods for the HTML <ul> element. |
|
Package variable provides constructors and methods for the HTML <var> element.
|
Package variable provides constructors and methods for the HTML <var> element. |
|
Package video provides constructors and methods for the HTML <video> element.
|
Package video provides constructors and methods for the HTML <video> element. |
|
Package wbr provides constructors and methods for the HTML <wbr> element.
|
Package wbr provides constructors and methods for the HTML <wbr> element. |