note

package
v0.0.0-...-7bda9f9 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VisibilityPublic  = Visibility("public")
	VisibilityPrivate = Visibility("private")
	VisibilitySecret  = Visibility("secret")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	Path      string
	Protected bool
}

type Color

type Color struct {
	R, G, B uint8
}

func (Color) MarshalYAML

func (c Color) MarshalYAML() (any, error)

func (Color) ToCSS

func (c Color) ToCSS() string

func (*Color) UnmarshalYAML

func (c *Color) UnmarshalYAML(f func(data any) error) error

type Config

type Config struct {
	Index              string `yaml:"index"`
	PrivateNoteMessage string `yaml:"private-note-message"`
	Rules              []Rule `yaml:"rules"`
	Style              Styles `yaml:"style"`
}

func (*Config) Dump

func (c *Config) Dump() string

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

func NewLoader

func NewLoader(dir string) *Loader

func (*Loader) LoadConfig

func (l *Loader) LoadConfig() (*Config, error)

func (*Loader) LoadNotebook

func (l *Loader) LoadNotebook(config *Config, tmpl *ui.Template) (*Notebook, error)

type Note

type Note struct {
	Name string
	ID   string

	Visibility Visibility
	Content    template.HTML

	Links     []*Note
	Backlinks []*Note
	// contains filtered or unexported fields
}

func (*Note) Path

func (n *Note) Path() string

func (*Note) Virtual

func (n *Note) Virtual() bool

Returns true if the note only exists because it's referenced by another note.

type Notebook

type Notebook struct {
	// Name => note
	Notes map[string]*Note

	IndexNote *Note
	Assets    map[string]Asset
}

type Rule

type Rule struct {
	Path       string     `yaml:"path"`
	Visibility Visibility `yaml:"visibility"`
}

type Style

type Style struct {
	Base                 Color `yaml:"base"`
	Background           Color `yaml:"background"`
	Foreground           Color `yaml:"foreground"`
	Border               Color `yaml:"border"`
	CodeBackground       Color `yaml:"code-background"`
	CodeForeground       Color `yaml:"code-foreground"`
	LinkForeground       Color `yaml:"link-foreground"`
	ActiveLinkBackground Color `yaml:"active-link-background"`
	ActiveLinkForeground Color `yaml:"active-link-foreground"`
}

type Styles

type Styles struct {
	Light Style `yaml:"light"`
	Dark  Style `yaml:"dark"`
}

type Visibility

type Visibility string

func (Visibility) MarshalYAML

func (v Visibility) MarshalYAML() (any, error)

func (*Visibility) UnmarshalYAML

func (v *Visibility) UnmarshalYAML(f func(data any) error) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL