Documentation
¶
Index ¶
- Constants
- func BuildFrontmatter(fm Frontmatter) string
- func BuildNoteContent(fm Frontmatter, body string) string
- func ComputeHash(content string) string
- func GenerateID() string
- func WordCount(s string) int
- type Frontmatter
- type Manager
- func (m *Manager) CreateNote(name, templateName string) (*storage.Note, error)
- func (m *Manager) DeleteNote(name string) error
- func (m *Manager) GetNote(noteID string) (*storage.Note, error)
- func (m *Manager) ListNotes() ([]*storage.Note, error)
- func (m *Manager) NotesDir() string
- func (m *Manager) OpenNote(name string) (*storage.Note, string, error)
- func (m *Manager) SearchNotes(query string) ([]*storage.Note, error)
- func (m *Manager) SyncFromDisk(noteID string) error
- type TemplateEngine
- type TemplateVars
Constants ¶
View Source
const BlankTemplate = `---
title: "{{.Title}}"
date: {{.Date}}
tags: []
---
`
View Source
const DailyTemplate = `---
title: "Daily Note - {{.Date}}"
date: {{.Date}}
tags: [daily]
---
## Today's Focus
## Tasks
- [ ]
## Notes
`
View Source
const MeetingTemplate = `` /* 160-byte string literal not displayed */
View Source
const ProjectTemplate = `` /* 129-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func BuildFrontmatter ¶
func BuildFrontmatter(fm Frontmatter) string
func BuildNoteContent ¶
func BuildNoteContent(fm Frontmatter, body string) string
func ComputeHash ¶
func GenerateID ¶
func GenerateID() string
Types ¶
type Frontmatter ¶
type Frontmatter struct {
Title string `yaml:"title"`
Date string `yaml:"date"`
Tags []string `yaml:"tags"`
}
func ParseFileFrontmatter ¶
func ParseFileFrontmatter(path string) (Frontmatter, string, error)
func ParseFrontmatter ¶
func ParseFrontmatter(content string) (Frontmatter, string, error)
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(vaultDir string, store *storage.NoteStore, tmpl *TemplateEngine) *Manager
func (*Manager) CreateNote ¶
func (*Manager) DeleteNote ¶
func (*Manager) SyncFromDisk ¶
type TemplateEngine ¶
type TemplateEngine struct {
// contains filtered or unexported fields
}
func NewTemplateEngine ¶
func NewTemplateEngine() *TemplateEngine
func (*TemplateEngine) Names ¶
func (e *TemplateEngine) Names() []string
type TemplateVars ¶
Click to show internal directories.
Click to hide internal directories.