zet

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

the zet package contians functions and structs for working with a zettelcasten. on the users system

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &bonzai.Cmd{
	Name:     "zet",
	Commands: []*bonzai.Cmd{help.Cmd, listCmd, deleteCmd, newCmd},
	Call: func(cmd *bonzai.Cmd, args ...string) error {
		zetDir, err := getZetDir()
		if err != nil {
			return err
		}

		search := ""
		if len(args) > 0 {
			search = args[0]
		}

		notes, err := ListNotes(zetDir)
		if err != nil {
			return err
		}

		note, err := findNote(notes, search)
		if err != nil {
			return err
		}

		editNote(note)
		return nil
	},
}

exported main command

Functions

func DeleteNote

func DeleteNote(dir string, note *Note) error

DeleteNote deletes a note from the zettelkasten.

Types

type Note

type Note struct {
	Title string
	Path  string
	Body  string
}

Note is a struct that represents a note in the zettelkasten.

func CreateNote

func CreateNote(dir string, title string) (*Note, error)

createNote creates a new note in the zettelkasten.

func ListNotes

func ListNotes(dir string) ([]*Note, error)

ListNotes lists all the notes in the zettelkasten.

Jump to

Keyboard shortcuts

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