Documentation
¶
Index ¶
- Constants
- Variables
- func EscapeString(ctx *core.Context, s core.StringLike) core.String
- func NewHTMLNamespace() *core.Namespace
- func Render(ctx *core.Context, v core.Value) *core.ByteSlice
- func RenderToString(ctx *core.Context, v core.Value) core.String
- type AttributeData
- type AttributeValueData
- type AttributeValueSet
- type DataReference
- type HTML5DocumentDescription
- type HTMLNode
- func CreateHTMLNodeFromXMLElement(ctx *core.Context, arg *core.XMLElement) *HTMLNode
- func CreateSpanElem(strLike core.StringLike) *HTMLNode
- func CreateTextLikeElem(strLike core.StringLike, atom atom.Atom) *HTMLNode
- func CreateTextNode(strLike core.StringLike) *HTMLNode
- func CreateTimeElem(strLike core.StringLike) *HTMLNode
- func NewHTML5DocumentNodeFromGoDescription(desc HTML5DocumentDescription) *HTMLNode
- func NewHTMLNode(n *html.Node) *HTMLNode
- func NewNode(ctx *core.Context, tag core.String, desc *core.Object) (finalNode *HTMLNode)
- func NewNodeFromGoDescription(desc NodeDescription) *HTMLNode
- func ParseSingleNodeHTML(nodeHTML string) (*HTMLNode, error)
- func (n *HTMLNode) AddNonceToScriptTagsNoEvent(nonce string)
- func (n *HTMLNode) AppendToAttribute(ctx *core.Context, newAttr html.Attribute)
- func (n *HTMLNode) Attr(name string) (string, bool)
- func (n *HTMLNode) AttrOrEmpty(name string) string
- func (n *HTMLNode) Clone(originState *core.GlobalState, sharableValues *[]core.PotentiallySharable, ...) (core.Value, error)
- func (n *HTMLNode) Data() string
- func (n *HTMLNode) DiscardCache()
- func (n *HTMLNode) Equal(ctx *core.Context, other core.Value, alreadyCompared map[uintptr]uintptr, ...) bool
- func (n *HTMLNode) GetGoMethod(name string) (*core.GoFunction, bool)
- func (n *HTMLNode) HasId() bool
- func (n *HTMLNode) HasNextSibling() bool
- func (n *HTMLNode) HasParent() bool
- func (n *HTMLNode) HasPrevSibling() bool
- func (n *HTMLNode) IsElementWithTag(tag string) bool
- func (n *HTMLNode) IsMutable() bool
- func (n *HTMLNode) IsRecursivelyRenderable(ctx *core.Context, input core.RenderingInput) bool
- func (n *HTMLNode) OnMutation(ctx *core.Context, microtask core.MutationCallbackMicrotask, ...) (core.CallbackHandle, error)
- func (n *HTMLNode) PrettyPrint(w *bufio.Writer, config *core.PrettyPrintConfig, depth int, ...)
- func (n *HTMLNode) Prop(ctx *core.Context, name string) core.Value
- func (n *HTMLNode) PropertyNames(ctx *core.Context) []string
- func (n *HTMLNode) RemoveAttribute(ctx *core.Context, name string)
- func (n *HTMLNode) RemoveMutationCallback(ctx *core.Context, handle core.CallbackHandle)
- func (n *HTMLNode) RemoveMutationCallbackMicrotasks(ctx *core.Context)
- func (n *HTMLNode) Render(ctx *core.Context, w io.Writer, config core.RenderingInput) (int, error)
- func (n *HTMLNode) ReplaceChildHTML(ctx *core.Context, prevHTMLNode *HTMLNode, child *HTMLNode)
- func (n *HTMLNode) SetAttribute(ctx *core.Context, newAttr html.Attribute)
- func (n *HTMLNode) SetId(ctx *core.Context, id core.String)
- func (*HTMLNode) SetProp(ctx *core.Context, name string, value core.Value) error
- func (n *HTMLNode) ToSymbolicValue(ctx *core.Context, encountered map[uintptr]symbolic.Value) (symbolic.Value, error)
- func (n *HTMLNode) Walk(fn func(n *HTMLNode) error) error
- func (n *HTMLNode) Watcher(ctx *core.Context, config core.WatcherConfiguration) core.Watcher
- func (n *HTMLNode) WriteJSONRepresentation(ctx *core.Context, w *jsoniter.Stream, config core.JSONSerializationConfig, ...) error
- func (n *HTMLNode) WriteRepresentation(ctx *core.Context, w io.Writer, config *core.ReprConfig, depth int) error
- type HtmxData
- type JSONFormData
- type NodeDescription
- type PseudoHtmxData
- type StandardData
- type TagData
Constants ¶
View Source
const ( CLASS_KEY = "class" ID_KEY = "id" CHILDREN_KEY = "children" ANCHOR_HREF_KEY = "href" MODEL_KEY = "model" S_NODE_ALREADY_HAS_A_PARENT = "node that already has a parent" S_NODE_ALREADY_HAS_SIBLINGS = "node that already has siblings" S_CHILDREN_ALREADY_PROVIDED_WITH_CHILDREN_PROP = "children already provided with .children" )
View Source
const ( MAX_PRETTY_PRINT_COST = 5000 MAX_PRETTY_PRINT_LINE_COUNT = 200 )
View Source
const MAX_WALKING_DEPTH = 1000
View Source
const (
NONCE_ATTRIBUTE_NAME = "nonce"
)
Variables ¶
View Source
var ( //go:embed data.json STANDARD_DATA_JSON []byte STANDARD_DATA StandardData VOID_HTML_TAG_NAMES []string )
View Source
var ( //go:embed jsonform-data.json PSEUDO_JSONFORM_DATA_JSON []byte JSONFORM_DATA PseudoHtmxData JSONFORM_ATTR_NAMES []string SHORTEST_JSONFORM_ATTR_NAME_LEN int = 100 )
View Source
var ( //go:embed pseudo-htmx-data.json PSEUDO_HTMX_DATA_JSON []byte PSEUDO_HTMX_DATA PseudoHtmxData PSEUDO_HTMX_ATTR_NAMES []string SHORTEST_PSEUDO_HTMX_ATTR_NAME_LEN int = 100 )
View Source
var (
ErrSingleNode = errors.New("a single HTML node was expected")
)
View Source
var ( NODE_PATTERN = &core.TypePattern{ Name: "html.node", Type: reflect.TypeOf(&HTMLNode{}), SymbolicValue: _html_symbolic.NewHTMLNode(), } )
Functions ¶
func EscapeString ¶
func NewHTMLNamespace ¶
Types ¶
type AttributeData ¶
type AttributeData struct { Name string `json:"name"` Description any `json:"description"` //string | MarkupContent ValueSet string `json:"valueSet"` References []DataReference `json:"references"` }
func GetAllTagAttributes ¶
func GetAllTagAttributes(name string) ([]AttributeData, bool)
func GetTagSpecificAttributes ¶
func GetTagSpecificAttributes(name string) ([]AttributeData, bool)
GetTagData returns the specific attributes of a tag (e.g "src" for "img"), the returned data should NOT be modified.
func (AttributeData) DescriptionContent ¶
func (d AttributeData) DescriptionContent() string
func (AttributeData) DescriptionText ¶
func (d AttributeData) DescriptionText() string
type AttributeValueData ¶
type AttributeValueData struct { Name string `json:"name"` Description any `json:"description"` //string | MarkupContent References []DataReference `json:"references"` }
func (AttributeValueData) DescriptionContent ¶
func (d AttributeValueData) DescriptionContent() string
func (AttributeValueData) DescriptionText ¶
func (d AttributeValueData) DescriptionText() string
type AttributeValueSet ¶
type AttributeValueSet struct { Name string `json:"name"` Values []AttributeValueData `json:"values"` }
func GetAttributeValueSet ¶
func GetAttributeValueSet(name string, tagName string) (set AttributeValueSet, found bool)
type DataReference ¶
type HTML5DocumentDescription ¶
type HTML5DocumentDescription struct {
HtmlTagNode *HTMLNode //this value should not be referenced elsewhere
}
type HTMLNode ¶
type HTMLNode struct {
// contains filtered or unexported fields
}
An HTMLNode is a wrapper around a stdlib's html.Node, HTMLNode implements Value. In Inox code XML expressions with the html namespace evaluate to an HTMLNode.
func CreateHTMLNodeFromXMLElement ¶
func CreateHTMLNodeFromXMLElement(ctx *core.Context, arg *core.XMLElement) *HTMLNode
func CreateSpanElem ¶
func CreateSpanElem(strLike core.StringLike) *HTMLNode
func CreateTextLikeElem ¶
func CreateTextLikeElem(strLike core.StringLike, atom atom.Atom) *HTMLNode
func CreateTextNode ¶
func CreateTextNode(strLike core.StringLike) *HTMLNode
func CreateTimeElem ¶
func CreateTimeElem(strLike core.StringLike) *HTMLNode
func NewHTML5DocumentNodeFromGoDescription ¶
func NewHTML5DocumentNodeFromGoDescription(desc HTML5DocumentDescription) *HTMLNode
func NewHTMLNode ¶
func NewNodeFromGoDescription ¶
func NewNodeFromGoDescription(desc NodeDescription) *HTMLNode
func ParseSingleNodeHTML ¶
func (*HTMLNode) AddNonceToScriptTagsNoEvent ¶
func (*HTMLNode) AppendToAttribute ¶
func (*HTMLNode) AttrOrEmpty ¶
func (*HTMLNode) DiscardCache ¶
func (n *HTMLNode) DiscardCache()
func (*HTMLNode) GetGoMethod ¶
func (n *HTMLNode) GetGoMethod(name string) (*core.GoFunction, bool)
func (*HTMLNode) HasNextSibling ¶
func (*HTMLNode) HasPrevSibling ¶
func (*HTMLNode) IsElementWithTag ¶
func (*HTMLNode) IsRecursivelyRenderable ¶
func (*HTMLNode) OnMutation ¶
func (n *HTMLNode) OnMutation(ctx *core.Context, microtask core.MutationCallbackMicrotask, config core.MutationWatchingConfiguration) (core.CallbackHandle, error)
func (*HTMLNode) PrettyPrint ¶
func (*HTMLNode) RemoveAttribute ¶
func (*HTMLNode) RemoveMutationCallback ¶
func (n *HTMLNode) RemoveMutationCallback(ctx *core.Context, handle core.CallbackHandle)
func (*HTMLNode) RemoveMutationCallbackMicrotasks ¶
func (*HTMLNode) ReplaceChildHTML ¶
func (*HTMLNode) SetAttribute ¶
func (*HTMLNode) ToSymbolicValue ¶
func (*HTMLNode) WriteJSONRepresentation ¶
type HtmxData ¶
type HtmxData struct { Version float64 `json:"version"` GlobalAttributes []AttributeData `json:"globalAttributes"` ValueSets []AttributeValueSet `json:"valueSets"` }
type JSONFormData ¶
type JSONFormData struct { Version float64 `json:"version"` GlobalAttributes []AttributeData `json:"globalAttributes"` ValueSets []AttributeValueSet `json:"valueSets"` }
type NodeDescription ¶
type PseudoHtmxData ¶
type PseudoHtmxData struct { Version float64 `json:"version"` GlobalAttributes []AttributeData `json:"globalAttributes"` ValueSets []AttributeValueSet `json:"valueSets"` }
type StandardData ¶
type StandardData struct { Version float64 `json:"version"` Tags []TagData `json:"tags"` GlobalAttributes []AttributeData `json:"globalAttributes"` ValueSets []AttributeValueSet `json:"valueSets"` }
type TagData ¶
type TagData struct { Name string `json:"name"` Description any `json:"description"` //string | MarkupContent Attributes []AttributeData `json:"attributes"` Void bool `json:"void"` References []DataReference `json:"references"` }
func GetTagData ¶
GetTagData returns the standard data about a tag (e.g "img", "p"), the returned data should NOT be modified.
func (TagData) DescriptionContent ¶
func (TagData) DescriptionText ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.