Documentation ¶
Index ¶
- func BuildDictWriteSheet(d *tokens.StringDict, node directives.Node) (string, error)
- func BuildFile(input string, outputPath string) error
- func SaveMathFont(dst string) error
- func WriteSheetToFile(s Sheet, path string) error
- type AtRule
- type AtRuleGen
- type AtSelector
- type AttrFilter
- type AttrFilterData
- type ContainsAttrFilter
- type ExactAttrFilter
- type FieldAttrFilter
- type GenericPseudoClass
- type Keyframe
- type KeyframesRule
- type PlainAttrFilter
- type PrefixAttrFilter
- type PseudoClass
- type Rule
- func ExpandAtRules(sel Selector, key *tokens.String, attr *tokens.StringDict) ([]Rule, error)
- func NewKeyframesRule(sel Selector, key *tokens.String, attr *tokens.StringDict) ([]Rule, error)
- func NewMediaRule(sel Selector, key *tokens.String, attr *tokens.StringDict) ([]Rule, error)
- func NewPageRule(sel Selector, key *tokens.String, attr *tokens.StringDict) ([]Rule, error)
- func NewSupportsRule(sel Selector, key *tokens.String, attr *tokens.StringDict) ([]Rule, error)
- func NewWrapGroupRule(sel Selector, key *tokens.String, attr *tokens.StringDict) ([]Rule, error)
- func NewWrapRule(sel Selector, key *tokens.String, attr *tokens.StringDict) ([]Rule, error)
- func NewWrapSiblingsRule(sel Selector, key *tokens.String, attr *tokens.StringDict) ([]Rule, error)
- type RuleData
- type Selector
- type SelectorData
- type Sheet
- type SheetData
- type SubcodeAttrFilter
- type SuffixAttrFilter
- type Wrap
- type WrapGroupRule
- type WrapRule
- type WrapRuleData
- type WrapSiblingsRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildDictWriteSheet ¶
func BuildDictWriteSheet(d *tokens.StringDict, node directives.Node) (string, error)
func SaveMathFont ¶
func WriteSheetToFile ¶
Types ¶
type AtRule ¶
type AtRule struct {
// contains filtered or unexported fields
}
func NewAtRule ¶
func NewAtRule(sel *AtSelector, rules []Rule) *AtRule
func (*AtRule) ExpandNested ¶
not called the first time. The subsequent times nothing should change
func (*AtRule) SetParent ¶
func (r *AtRule) SetParent(parent *AtSelector)
type AtSelector ¶
type AtSelector struct {
// contains filtered or unexported fields
}
at rules can be endlessly deeply nested
func NewAtSelector ¶
func NewAtSelector(key *tokens.String) *AtSelector
func (*AtSelector) Context ¶ added in v0.6.0
func (s *AtSelector) Context() context.Context
func (*AtSelector) SetParent ¶
func (s *AtSelector) SetParent(parent *AtSelector)
func (*AtSelector) Write ¶
func (s *AtSelector) Write() string
type AttrFilter ¶
func ParseAttrFilter ¶
func ParseAttrFilter(t_ raw.Token) (AttrFilter, error)
type AttrFilterData ¶
type AttrFilterData struct {
// contains filtered or unexported fields
}
type ContainsAttrFilter ¶
type ContainsAttrFilter struct {
AttrFilterData
}
func NewContainsAttrFilter ¶
func NewContainsAttrFilter(name string, value string, ci bool) *ContainsAttrFilter
func (*ContainsAttrFilter) Write ¶
func (f *ContainsAttrFilter) Write() string
type ExactAttrFilter ¶
type ExactAttrFilter struct {
AttrFilterData
}
func NewExactAttrFilter ¶
func NewExactAttrFilter(name string, value string, ci bool) *ExactAttrFilter
value should be in quotes in the final code
func (*ExactAttrFilter) Write ¶
func (f *ExactAttrFilter) Write() string
type FieldAttrFilter ¶
type FieldAttrFilter struct {
AttrFilterData
}
func NewFieldAttrFilter ¶
func NewFieldAttrFilter(name string, value string, ci bool) *FieldAttrFilter
func (*FieldAttrFilter) Write ¶
func (f *FieldAttrFilter) Write() string
type GenericPseudoClass ¶
type GenericPseudoClass struct {
// contains filtered or unexported fields
}
func NewGenericPseudoClass ¶
func NewGenericPseudoClass(name string) *GenericPseudoClass
func NewGenericPseudoClassWithArgs ¶
func NewGenericPseudoClassWithArgs(name string, args string) *GenericPseudoClass
func (*GenericPseudoClass) Write ¶
func (p *GenericPseudoClass) Write() string
type Keyframe ¶
type Keyframe struct {
// contains filtered or unexported fields
}
TODO: uniqueness of keyframes name?
type KeyframesRule ¶
type KeyframesRule struct {
// contains filtered or unexported fields
}
func (*KeyframesRule) Context ¶ added in v0.6.0
func (r *KeyframesRule) Context() context.Context
func (*KeyframesRule) ExpandNested ¶
func (r *KeyframesRule) ExpandNested() ([]Rule, error)
type PlainAttrFilter ¶
type PlainAttrFilter struct {
AttrFilterData
}
func NewPlainAttrFilter ¶
func NewPlainAttrFilter(name string) *PlainAttrFilter
func (*PlainAttrFilter) Write ¶
func (f *PlainAttrFilter) Write() string
type PrefixAttrFilter ¶
type PrefixAttrFilter struct {
AttrFilterData
}
func NewPrefixAttrFilter ¶
func NewPrefixAttrFilter(name string, value string, ci bool) *PrefixAttrFilter
func (*PrefixAttrFilter) Write ¶
func (f *PrefixAttrFilter) Write() string
type PseudoClass ¶
type PseudoClass interface {
Write() string
}
func ParsePseudoClass ¶
func ParsePseudoClass(ts []raw.Token) (PseudoClass, error)
type Rule ¶
type Rule interface { ExpandNested() ([]Rule, error) // includes self as first //ExpandLazy(root *tree.Root) ([]Rule, error) // modifies the root!, adding rules, but keeping all the originals untouched, any remaining lazy values are ignored in the core rule output Write(indent string, nl string, tab string) (string, error) Context() context.Context }
func ExpandAtRules ¶
sel == nil is toplevel at rule
func NewKeyframesRule ¶
func NewMediaRule ¶
func NewPageRule ¶
func NewSupportsRule ¶
func NewWrapGroupRule ¶ added in v0.6.0
func NewWrapRule ¶
func NewWrapSiblingsRule ¶
type RuleData ¶
type RuleData struct {
// contains filtered or unexported fields
}
func (*RuleData) ExpandNested ¶
type Selector ¶
type SelectorData ¶
type SelectorData struct {
// contains filtered or unexported fields
}
func ParseSelector ¶
func ParseSelector(ts []raw.Token) (*SelectorData, error)
func (*SelectorData) Context ¶ added in v0.6.0
func (s *SelectorData) Context() context.Context
func (*SelectorData) Copy ¶
func (s *SelectorData) Copy() *SelectorData
func (*SelectorData) Extend ¶
func (s *SelectorData) Extend(extra *tokens.String) ([]Selector, error)
func (*SelectorData) Write ¶
func (s *SelectorData) Write() string
type Sheet ¶
type Sheet interface { Append(r Rule) IsEmpty() bool Len() int //IsNotLazy() bool Write(compr bool, nl string, tab string) (string, error) ExpandNested() (Sheet, error) // expanding a second time does nothing ApplyExtensions(root *tree.Root) (*tree.Root, error) }
type SheetData ¶
type SheetData struct {
// contains filtered or unexported fields
}
func (*SheetData) ApplyExtensions ¶
func (*SheetData) ExpandNested ¶
type SubcodeAttrFilter ¶
type SubcodeAttrFilter struct {
AttrFilterData
}
func NewSubcodeAttrFilter ¶
func NewSubcodeAttrFilter(name string, value string, ci bool) *SubcodeAttrFilter
func (*SubcodeAttrFilter) Write ¶
func (f *SubcodeAttrFilter) Write() string
type SuffixAttrFilter ¶
type SuffixAttrFilter struct {
AttrFilterData
}
func NewSuffixAttrFilter ¶
func NewSuffixAttrFilter(name string, value string, ci bool) *SuffixAttrFilter
func (*SuffixAttrFilter) Write ¶
func (f *SuffixAttrFilter) Write() string
type WrapGroupRule ¶ added in v0.6.0
type WrapGroupRule struct {
WrapRuleData
}
func (*WrapGroupRule) ApplyWrap ¶ added in v0.6.0
func (r *WrapGroupRule) ApplyWrap(tag tree.Tag) error
func (*WrapGroupRule) ExpandNested ¶ added in v0.6.0
func (r *WrapGroupRule) ExpandNested() ([]Rule, error)
type WrapRuleData ¶ added in v0.6.0
type WrapRuleData struct {
// contains filtered or unexported fields
}
func (*WrapRuleData) Context ¶ added in v0.6.0
func (r *WrapRuleData) Context() context.Context
type WrapSiblingsRule ¶ added in v0.6.0
type WrapSiblingsRule struct {
WrapRuleData
}
func (*WrapSiblingsRule) ApplyWrap ¶ added in v0.6.0
func (r *WrapSiblingsRule) ApplyWrap(tag tree.Tag) error
func (*WrapSiblingsRule) ExpandNested ¶ added in v0.6.0
func (r *WrapSiblingsRule) ExpandNested() ([]Rule, error)
Click to show internal directories.
Click to hide internal directories.