Documentation
¶
Overview ¶
Package metadata provides Keep note parsing and structures.
Index ¶
- type Annotation
- type Attachment
- type Checkbox
- type KeepLibrary
- type Label
- type Note
- func (n *Note) AnnotationsMarkdown() string
- func (n *Note) AttachmentsMarkdown() string
- func (n *Note) CheckboxesMarkdown() string
- func (n *Note) ContentType() string
- func (n *Note) FormatTimestamp(layout string) string
- func (n *Note) GetLabelNames() []string
- func (n *Note) HasAnnotations() bool
- func (n *Note) HasAttachments() bool
- func (n *Note) HasCheckboxes() bool
- func (n *Note) IsEmpty() bool
- func (n *Note) LabelsMarkdown() string
- func (n *Note) ToMarkdown(includeMetadata bool) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Annotation ¶
type Annotation struct {
Description string `json:"description"`
Source string `json:"source"`
Title string `json:"title"`
URL string `json:"url"`
}
Annotation represents a link annotation in a note.
type Attachment ¶
Attachment represents a file attached to a note.
type KeepLibrary ¶
type KeepLibrary struct {
Notes []Note `json:"notes"`
NotesPath string `json:"notes_path"`
Stats map[string]int `json:"stats"`
}
KeepLibrary represents a collection of parsed Keep notes.
type Note ¶
type Note struct {
Title string `json:"title"`
Content string `json:"content"`
TextContent string `json:"textContent"`
Created time.Time `json:"created"`
Modified time.Time `json:"modified"`
Labels []Label `json:"labels"`
Color string `json:"color"`
IsArchived bool `json:"isArchived"`
IsPinned bool `json:"isPinned"`
IsTrashed bool `json:"isTrashed"`
Checkboxes []Checkbox `json:"checkboxes"`
Attachments []Attachment `json:"attachments"`
Annotations []Annotation `json:"annotations"`
RawJSON map[string]any `json:"-"`
}
Note represents a Google Keep note with all its metadata.
func ParseKeepNote ¶
ParseKeepNote parses a Keep note JSON file.
func (*Note) AnnotationsMarkdown ¶
AnnotationsMarkdown returns the annotations formatted as Markdown links.
func (*Note) AttachmentsMarkdown ¶
AttachmentsMarkdown returns the attachments formatted as Markdown.
func (*Note) CheckboxesMarkdown ¶
CheckboxesMarkdown returns the checkboxes formatted as Markdown.
func (*Note) ContentType ¶
ContentType returns a string describing the note's content type.
func (*Note) FormatTimestamp ¶
FormatTimestamp formats a timestamp using the given format string.
func (*Note) GetLabelNames ¶
GetLabelNames returns a slice of label names.
func (*Note) HasAnnotations ¶
HasAnnotations returns true if this note has link annotations.
func (*Note) HasAttachments ¶
HasAttachments returns true if this note has attachments.
func (*Note) HasCheckboxes ¶
HasCheckboxes returns true if this note contains checkboxes.
func (*Note) LabelsMarkdown ¶
LabelsMarkdown returns the labels formatted as Markdown tags.
func (*Note) ToMarkdown ¶
ToMarkdown converts the note to Markdown format.