Documentation ¶
Index ¶
- func EmptyAttribute(name string) attribute
- func LiteralAttribute(name string, value any) attribute
- func VarAttribute(name, varName string) attribute
- type AnnotationStart
- type Builder
- func (b *Builder) Build() (string, error)
- func (b *Builder) CloseMarkup(name string, attributes ...attribute) *Builder
- func (b *Builder) Expr(expr *Expression) *Builder
- func (b *Builder) Input(expr *Expression) *Builder
- func (b *Builder) Keys(key any, keys ...any) *Builder
- func (b *Builder) Local(v string, expr *Expression) *Builder
- func (b *Builder) Match(selector *Expression, selectors ...*Expression) *Builder
- func (b *Builder) MustBuild() string
- func (b *Builder) Newline(s string) *Builder
- func (b *Builder) OpenMarkup(name string, optionsAndAttributes ...OptsAndAttr) *Builder
- func (b *Builder) Reserved(keyword string, expression *Expression, ...) *Builder
- func (b *Builder) SelfCloseMarkup(name string, optionsAndAttributes ...OptsAndAttr) *Builder
- func (b *Builder) Spacing(s string) *Builder
- func (b *Builder) Text(s string) *Builder
- type Expression
- func (e *Expression) Annotation(start AnnotationStart, reservedBody ...ReservedBody) *Expression
- func (e *Expression) Attr(attributes ...attribute) *Expression
- func (e *Expression) Func(name string, option ...FuncOption) *Expression
- func (e *Expression) Literal(v any) *Expression
- func (e *Expression) Var(name string) *Expression
- type FuncOption
- type OptsAndAttr
- type Quoted
- type ReservedBody
- type ReservedOrExpression
- type ReservedText
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmptyAttribute ¶
func EmptyAttribute(name string) attribute
func LiteralAttribute ¶
func VarAttribute ¶
func VarAttribute(name, varName string) attribute
Types ¶
type AnnotationStart ¶
type AnnotationStart int
const ( Caret AnnotationStart = iota // ^ Ampersand // & )
Private Use start character.
const ( Exclamation AnnotationStart = iota + 2 // ! Percent // % Asterisk // * Plus // + LessThan // < GreaterThan // > Question // ? Tilde // ~ )
Reserved start character.
func (AnnotationStart) String ¶
func (a AnnotationStart) String() string
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder() *Builder
func (*Builder) CloseMarkup ¶
func (*Builder) Expr ¶
func (b *Builder) Expr(expr *Expression) *Builder
func (*Builder) Input ¶
func (b *Builder) Input(expr *Expression) *Builder
Input adds input declaration to the builder.
func (*Builder) Local ¶
func (b *Builder) Local(v string, expr *Expression) *Builder
Local adds local declaration to the builder.
func (*Builder) Match ¶
func (b *Builder) Match(selector *Expression, selectors ...*Expression) *Builder
func (*Builder) OpenMarkup ¶
func (b *Builder) OpenMarkup(name string, optionsAndAttributes ...OptsAndAttr) *Builder
func (*Builder) Reserved ¶
func (b *Builder) Reserved( keyword string, expression *Expression, reservedOrExpression ...ReservedOrExpression, ) *Builder
Reserved adds reserved statement to the builder.
func (*Builder) SelfCloseMarkup ¶
func (b *Builder) SelfCloseMarkup(name string, optionsAndAttributes ...OptsAndAttr) *Builder
type Expression ¶
type Expression struct {
// contains filtered or unexported fields
}
func Annotation ¶
func Annotation(start AnnotationStart, reservedBody ...ReservedBody) *Expression
Annotation adds Private Use or Reserved annotation to the expression.
func Expr ¶
func Expr() *Expression
func Literal ¶
func Literal(v any) *Expression
func Var ¶
func Var(name string) *Expression
func (*Expression) Annotation ¶
func (e *Expression) Annotation(start AnnotationStart, reservedBody ...ReservedBody) *Expression
Annotation adds Private Use or Reserved annotation to the expression.
func (*Expression) Attr ¶
func (e *Expression) Attr(attributes ...attribute) *Expression
Attr adds attributes to the expression.
func (*Expression) Func ¶
func (e *Expression) Func(name string, option ...FuncOption) *Expression
func (*Expression) Literal ¶
func (e *Expression) Literal(v any) *Expression
func (*Expression) Var ¶
func (e *Expression) Var(name string) *Expression
type FuncOption ¶
type FuncOption struct {
// contains filtered or unexported fields
}
func LiteralOption ¶
func LiteralOption(name string, value any) FuncOption
func VarOption ¶
func VarOption(name, varName string) FuncOption
type OptsAndAttr ¶
type OptsAndAttr interface {
// contains filtered or unexported methods
}
Hack: limit to only options and attributes, instead of any.
type ReservedBody ¶
type ReservedBody interface {
// contains filtered or unexported methods
}
type ReservedOrExpression ¶
type ReservedOrExpression interface {
// contains filtered or unexported methods
}
type ReservedText ¶
type ReservedText string
Click to show internal directories.
Click to hide internal directories.