Documentation
¶
Overview ¶
Package attrs stores attributes of zettel parts.
Index ¶
- Constants
- type Attributes
- func (a Attributes) Add(key, value string) Attributes
- func (a Attributes) AddClass(class string) Attributes
- func (a Attributes) Clone() Attributes
- func (a Attributes) Get(key string) (string, bool)
- func (a Attributes) GetClasses() []string
- func (a Attributes) Has(key, value string) bool
- func (a Attributes) HasClass(s string) bool
- func (a Attributes) HasDefault() bool
- func (a Attributes) IsEmpty() bool
- func (a Attributes) Keys() []string
- func (a Attributes) Remove(key string) Attributes
- func (a Attributes) RemoveDefault() Attributes
- func (a Attributes) Set(key, value string) Attributes
- func (a Attributes) Values(key string) []string
Constants ¶
const DefaultAttribute = "-"
DefaultAttribute is the value of the key of the default attribute
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attributes ¶
Attributes store additional information about some node types.
func (Attributes) Add ¶
func (a Attributes) Add(key, value string) Attributes
Add a value to an attribute key.
func (Attributes) AddClass ¶
func (a Attributes) AddClass(class string) Attributes
AddClass adds a value to the class attribute.
func (Attributes) Clone ¶
func (a Attributes) Clone() Attributes
Clone returns a duplicate of the attribute.
func (Attributes) Get ¶
func (a Attributes) Get(key string) (string, bool)
Get returns the attribute value of the given key and a succes value.
func (Attributes) GetClasses ¶
func (a Attributes) GetClasses() []string
GetClasses returns the class values as a string slice
func (Attributes) Has ¶
func (a Attributes) Has(key, value string) bool
Has the attribute key a value?
func (Attributes) HasClass ¶
func (a Attributes) HasClass(s string) bool
HasClass returns true, if attributes contains the given class.
func (Attributes) HasDefault ¶
func (a Attributes) HasDefault() bool
HasDefault returns true, if the default attribute "-" has been set.
func (Attributes) IsEmpty ¶
func (a Attributes) IsEmpty() bool
IsEmpty returns true if there are no attributes.
func (Attributes) Remove ¶
func (a Attributes) Remove(key string) Attributes
Remove the key from the attributes.
func (Attributes) RemoveDefault ¶
func (a Attributes) RemoveDefault() Attributes
RemoveDefault removes the default attribute
func (Attributes) Set ¶
func (a Attributes) Set(key, value string) Attributes
Set changes the attribute that a given key has now a given value.
func (Attributes) Values ¶
func (a Attributes) Values(key string) []string
Values are the space separated values of an attribute.