metadata

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package metadata provides Keep note parsing and structures.

Index

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

type Attachment struct {
	FilePath string `json:"filePath"`
	MimeType string `json:"mimetype"`
}

Attachment represents a file attached to a note.

type Checkbox

type Checkbox struct {
	Text    string `json:"text"`
	Checked bool   `json:"checked"`
}

Checkbox represents a checklist item.

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 Label

type Label struct {
	Name string `json:"name"`
}

Label represents a Keep label/tag.

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

func ParseKeepNote(jsonPath string) (Note, error)

ParseKeepNote parses a Keep note JSON file.

func (*Note) AnnotationsMarkdown

func (n *Note) AnnotationsMarkdown() string

AnnotationsMarkdown returns the annotations formatted as Markdown links.

func (*Note) AttachmentsMarkdown

func (n *Note) AttachmentsMarkdown() string

AttachmentsMarkdown returns the attachments formatted as Markdown.

func (*Note) CheckboxesMarkdown

func (n *Note) CheckboxesMarkdown() string

CheckboxesMarkdown returns the checkboxes formatted as Markdown.

func (*Note) ContentType

func (n *Note) ContentType() string

ContentType returns a string describing the note's content type.

func (*Note) FormatTimestamp

func (n *Note) FormatTimestamp(layout string) string

FormatTimestamp formats a timestamp using the given format string.

func (*Note) GetLabelNames

func (n *Note) GetLabelNames() []string

GetLabelNames returns a slice of label names.

func (*Note) HasAnnotations

func (n *Note) HasAnnotations() bool

HasAnnotations returns true if this note has link annotations.

func (*Note) HasAttachments

func (n *Note) HasAttachments() bool

HasAttachments returns true if this note has attachments.

func (*Note) HasCheckboxes

func (n *Note) HasCheckboxes() bool

HasCheckboxes returns true if this note contains checkboxes.

func (*Note) IsEmpty

func (n *Note) IsEmpty() bool

IsEmpty returns true if the note has no meaningful content.

func (*Note) LabelsMarkdown

func (n *Note) LabelsMarkdown() string

LabelsMarkdown returns the labels formatted as Markdown tags.

func (*Note) ToMarkdown

func (n *Note) ToMarkdown(includeMetadata bool) string

ToMarkdown converts the note to Markdown format.

Jump to

Keyboard shortcuts

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