attrs

package
v0.0.0-...-d73c989 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2025 License: EUPL-1.2 Imports: 3 Imported by: 9

Documentation

Overview

Package attrs stores attributes of zettel parts.

Index

Constants

View Source
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

type Attributes map[string]string

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) Keys

func (a Attributes) Keys() []string

Keys returns the sorted list of keys.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳