Documentation
¶
Index ¶
- func BuildDailyNotePath(diaryDir string, date time.Time) string
- func BuildDailyNoteSections(cfg *config.LoadedConfig) []string
- func CreateDailyNote(ctx context.Context, notePath string, sections []string, date time.Time) error
- func CreateNote(ctx context.Context, path string, content string) error
- func EnsureDir(path string) error
- func FindNotes(ctx context.Context, dir string) ([]string, error)
- func GetDailyNotePath(date time.Time) (string, error)
- func GetEditorCmd(path string) (*exec.Cmd, error)
- func GetEditorCmdWithContext(ctx context.Context, path string) (*exec.Cmd, error)
- func GetEditorCmdWithShellFallback(ctx context.Context, path string) (*exec.Cmd, error)
- func GetNotesByPattern(ctx context.Context, pattern string) ([]string, error)
- func GetNotesByTag(ctx context.Context, tag string, limit int) ([]string, error)
- func GetRecentDailyNotes(ctx context.Context, diaryDir string, count int) ([]string, error)
- func OpenInEditor(path string) error
- func OpenInEditorWithContext(ctx context.Context, path string) error
- func UpdateIndex(ctx context.Context, path string, content string) error
- func UpdateLinks(ctx context.Context) error
- func WriteNote(ctx context.Context, path string, content string) error
- type Note
- type SearchMatch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildDailyNotePath ¶
BuildDailyNotePath builds the path for a daily note.
func BuildDailyNoteSections ¶
func BuildDailyNoteSections(cfg *config.LoadedConfig) []string
BuildDailyNoteSections returns the sections list for a daily note from config.
func CreateDailyNote ¶
CreateDailyNote creates a daily note with template with context support.
func CreateNote ¶
CreateNote creates a note file with the given content.
func FindNotes ¶
FindNotes finds all markdown files in a directory recursively with context support.
func GetDailyNotePath ¶
GetDailyNotePath returns the path for today's daily note.
func GetEditorCmd ¶
GetEditorCmd returns a command to open a file in the editor.
func GetEditorCmdWithContext ¶
GetEditorCmdWithContext returns a command to open a file in the editor, with context support.
func GetNotesByPattern ¶
GetNotesByPattern finds notes matching the given glob pattern.
func GetNotesByTag ¶
func GetRecentDailyNotes ¶
GetRecentDailyNotes gets the most recent daily notes with context support.
func OpenInEditor ¶
OpenInEditor opens a file in the user's preferred editor. Note: External edits via this function do not automatically update the search index. Run 'jotr index sync' to sync external modifications.
func UpdateIndex ¶ added in v1.3.0
func UpdateLinks ¶
Types ¶
type Note ¶
type Note struct {
Date time.Time
Metadata map[string]interface{}
Path string
Name string
Content string
}
Note represents a note file.
type SearchMatch ¶ added in v1.3.0
SearchMatch represents a file that matched a search query, including its content.