vault

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package vault implements a note index with wikilink resolution. It provides a simple interface to walk a directory tree, collect all markdown files, and resolve note references by name (case-insensitive) with tie-breaking on path length.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Note

type Note struct {
	Name string // base filename without ".md"
	Path string // absolute path
}

Note represents a markdown file in the vault.

type Vault

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

Vault is a note index built from a root directory.

func Open

func Open(root string) (*Vault, error)

Open walks the root directory recursively, collecting all .md files (skipping directories whose names start with "."), and returns a new Vault. It returns an error if the root directory cannot be accessed.

func (*Vault) List

func (v *Vault) List() []Note

List returns all notes in the vault, sorted by Name.

func (*Vault) Rescan

func (v *Vault) Rescan() error

Rescan rebuilds the note index by walking the root directory again.

func (*Vault) Resolve

func (v *Vault) Resolve(target string) (string, bool)

Resolve resolves a note by name (case-insensitive). It accepts both "nota" and "nota.md". If multiple notes match (differ only in path), it returns the one with the shortest path; if paths are equal length, the lexicographically smaller path wins, so the result is deterministic. It returns ("", false) if no note matches.

func (*Vault) Root

func (v *Vault) Root() string

Root returns the vault's root directory.

func (*Vault) Warnings added in v0.2.0

func (v *Vault) Warnings() []string

Warnings returns human-readable warnings about paths that were skipped during the last scan (e.g. unreadable subdirectories), if any.

Jump to

Keyboard shortcuts

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