note

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package note provides functionality for managing zettelkasten (atomic) notes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNotesInDirectory

func GetNotesInDirectory(vaultDir, subDir string) ([]string, error)

GetNotesInDirectory retrieves all note filenames in the specified vault and subdirectory.

func OpenFromPath

func OpenFromPath(path string, obsidian bool) error

OpenFromPath opens the note in the configured editor.

func StaticHandleNoteLaunch

func StaticHandleNoteLaunch(
	note *ZettelkastenNote,
	t *templater.Templater,
	tmpl, content string,
)

TODO: return errors StaticHandleNoteLaunch handles the creation and opening of a note.

Types

type ZettelkastenNote

type ZettelkastenNote struct {
	VaultDir      string
	SubDir        string
	Filename      string
	Upstream      string
	OriginalTags  []string
	OriginalLinks []string
}

ZettelkastenNote represents a zettelkasten note with its metadata.

func NewZettelkastenNote

func NewZettelkastenNote(
	vaultDir string,
	subDir string,
	filename string,
	tags []string,
	links []string,
	upstream string,
) *ZettelkastenNote

NewZettelkastenNote creates a new ZettelkastenNote instance.

func (*ZettelkastenNote) Create

func (note *ZettelkastenNote) Create(
	tmplName string,
	t *templater.Templater,
	content string,
) (bool, error)

Create generates a new Zettelkasten note using a template.

func (*ZettelkastenNote) EnsurePath

func (note *ZettelkastenNote) EnsurePath() (string, error)

EnsurePath creates the necessary directory structure for the note file.

func (*ZettelkastenNote) FileExists

func (note *ZettelkastenNote) FileExists() (bool, string, error)

FileExists checks if the zettelkasten note file already exists.

func (*ZettelkastenNote) GetFilepath

func (note *ZettelkastenNote) GetFilepath() string

GetFilepath returns the file path of the zettelkasten note.

func (*ZettelkastenNote) HandleConflicts

func (note *ZettelkastenNote) HandleConflicts() error

HandleConflicts checks for file naming conflicts and provides suggestions.

func (*ZettelkastenNote) Open

func (note *ZettelkastenNote) Open() error

Open opens the Zettelkasten note in the configured editor.

Jump to

Keyboard shortcuts

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