notes

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DateFormat is the format used for note filenames (YYYY-MM-DD)
	DateFormat = "2006-01-02"
)

Variables

This section is empty.

Functions

func FindNextNote

func FindNextNote(date time.Time, noteType NoteType, dir string, searchWindowDays int) (string, error)

FindNextNote finds the next note file after the given date within the search window.

Parameters:

  • date: the starting date
  • noteType: the type of note (journal or standup)
  • dir: the directory to search in
  • searchWindowDays: how many days forward to search

Returns:

  • the absolute path to the found note file
  • error if no note found within search window

func FindNoteByDate

func FindNoteByDate(date time.Time, noteType NoteType, dir string, searchWindowDays int) (string, error)

FindNoteByDate finds a note file for the given date, with fallback to previous dates within the search window if the exact date doesn't exist.

Parameters:

  • date: the target date to find
  • noteType: the type of note (journal or standup)
  • dir: the directory to search in
  • searchWindowDays: how many days back to search if exact date not found

Returns:

  • the absolute path to the found note file
  • error if no note found within search window or other errors

func GenerateFilename

func GenerateFilename(date time.Time) string

GenerateFilename generates a filename for a note of the given date

func ParseDateFromFilename

func ParseDateFromFilename(filename string) (time.Time, error)

ParseDateFromFilename extracts the date from a note filename Expected format: YYYY-MM-DD.md

Types

type NoteType

type NoteType string

NoteType represents the type of note (journal, standup, etc.)

const (
	// NoteTypeJournal represents a daily journal entry
	NoteTypeJournal NoteType = "journal"

	// NoteTypeStandup represents a daily standup note
	NoteTypeStandup NoteType = "standup"
)

func (NoteType) IsValid

func (nt NoteType) IsValid() bool

IsValid checks if the note type is valid

func (NoteType) String

func (nt NoteType) String() string

String returns the string representation of the note type

Jump to

Keyboard shortcuts

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