sncli

package
v0.0.0-...-8cc4406 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: AGPL-3.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SNServerURL       = "https://api.standardnotes.com"
	SNPageSize        = 600
	SNAppName         = "sn-cli"
	MinPasswordLength = 8
)

Variables

This section is empty.

Functions

func ApplyOrganizeChanges

func ApplyOrganizeChanges(session *cache.Session, changes []ProposedChange, debug bool) error

ApplyOrganizeChanges applies the confirmed changes to notes and tags.

func BuiltInTemplates

func BuiltInTemplates() map[string]Template

BuiltInTemplates returns a map of built-in templates

func CommaSplit

func CommaSplit(i string) []string

func DecryptString

func DecryptString(input DecryptStringInput) (string, error)

func GetDefaultVariables

func GetDefaultVariables() map[string]string

GetDefaultVariables returns default template variables

func GetTemplateDir

func GetTemplateDir() (string, error)

GetTemplateDir returns the default template directory

func ItemKeysHealthcheck

func ItemKeysHealthcheck(input ItemsKeysHealthcheckInput) error

func OutputSession

func OutputSession(input OutputSessionInput) error

func ProcessTemplate

func ProcessTemplate(template Template, vars map[string]string) (title, content string, tags []string)

ProcessTemplate processes a template with variable substitution

func RemoveDeleted

func RemoveDeleted(in items.Items) items.Items

func Resync

func Resync(s *cache.Session, cacheDBDir, appName string) error

func SaveTemplate

func SaveTemplate(template Template, templateDir string) error

SaveTemplate saves a template to the template directory

func StringInSlice

func StringInSlice(inStr string, inSlice []string, matchCase bool) bool

func Sync

func Sync(si cache.SyncInput, useStdErr bool) (cache.SyncOutput, error)

Types

type AddAdvancedChecklistTaskInput

type AddAdvancedChecklistTaskInput struct {
	Session  *cache.Session
	Debug    bool
	UUID     string
	Title    string
	Group    string
	Tasklist string
}

func (*AddAdvancedChecklistTaskInput) Run

type AddNoteInput

type AddNoteInput struct {
	Session  *cache.Session
	Title    string
	Text     string
	FilePath string
	Tags     []string
	Replace  bool
	Debug    bool
}

func (*AddNoteInput) Run

func (i *AddNoteInput) Run() error

type AddTagsInput

type AddTagsInput struct {
	Session    *cache.Session
	Tags       []string
	Parent     string
	ParentUUID string
	Debug      bool
	Replace    bool
}

func (*AddTagsInput) Run

func (i *AddTagsInput) Run() (AddTagsOutput, error)

type AddTagsOutput

type AddTagsOutput struct {
	Added, Existing []string
}

type AddTaskInput

type AddTaskInput struct {
	Session  *cache.Session
	Debug    bool
	Title    string
	UUID     string
	Tasklist string
}

func (*AddTaskInput) Run

func (ci *AddTaskInput) Run() error

type AdvancedChecklist

type AdvancedChecklist struct {
	UUID            string                   `json:"-"`
	Duplicates      []AdvancedChecklist      `json:"-"`
	Title           string                   `json:"-"`
	SchemaVersion   string                   `json:"schemaVersion"`
	Groups          []AdvancedChecklistGroup `json:"groups"`
	DefaultSections []DefaultSection         `json:"defaultSections"`
	UpdatedAt       time.Time                `json:"updatedAt"`
	Trashed         bool                     `json:"trashed"`
}

func (*AdvancedChecklist) Sort

func (c *AdvancedChecklist) Sort()

type AdvancedChecklistGroup

type AdvancedChecklistGroup struct {
	Name       string                     `json:"name"`
	LastActive time.Time                  `json:"lastActive"`
	Sections   []AdvancedChecklistSection `json:"sections"`
	Tasks      AdvancedChecklistTasks     `json:"tasks"`
	Collapsed  bool                       `json:"collapsed"`
}

type AdvancedChecklistSection

type AdvancedChecklistSection struct {
	Id        string `json:"id"`
	Name      string `json:"name"`
	Collapsed bool   `json:"collapsed"`
}

type AdvancedChecklistTask

type AdvancedChecklistTask struct {
	Id          string    `json:"id"`
	Description string    `json:"description"`
	Completed   bool      `json:"completed"`
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`
}

type AdvancedChecklistTasks

type AdvancedChecklistTasks []AdvancedChecklistTask

func (*AdvancedChecklistTasks) Sort

func (t *AdvancedChecklistTasks) Sort()

type AppDataContentJSON

type AppDataContentJSON struct {
	OrgStandardNotesSN           OrgStandardNotesSNDetailJSON             `json:"org.standardnotes.sn"`
	OrgStandardNotesSNComponents items.OrgStandardNotesSNComponentsDetail `json:"org.standardnotes.sn.components,omitempty"`
}

type AppDataContentYAML

type AppDataContentYAML struct {
	OrgStandardNotesSN           OrgStandardNotesSNDetailYAML             `yaml:"org.standardnotes.sn"`
	OrgStandardNotesSNComponents items.OrgStandardNotesSNComponentsDetail `yaml:"org.standardnotes.sn.components,omitempty"`
}

type BackupConfig

type BackupConfig struct {
	Session        *cache.Session
	OutputFile     string
	Incremental    bool
	LastBackupTime string
	Encrypt        bool
	Password       string
	Debug          bool
}

BackupConfig holds backup configuration

func (*BackupConfig) Run

func (b *BackupConfig) Run() error

Run executes the backup

type BackupItem

type BackupItem struct {
	UUID      string `json:"uuid"`
	Type      string `json:"type"`
	Content   string `json:"content"`
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

BackupItem represents an item in the backup

type BackupManifest

type BackupManifest struct {
	Timestamp   string         `json:"timestamp"`
	ItemCounts  map[string]int `json:"item_counts"`
	Incremental bool           `json:"incremental"`
	Encrypted   bool           `json:"encrypted"`
	Version     string         `json:"version"`
}

BackupManifest contains metadata about the backup

func GetBackupInfo

func GetBackupInfo(filename string, password string) (BackupManifest, error)

GetBackupInfo reads backup metadata without restoring

type CompleteAdvancedTaskInput

type CompleteAdvancedTaskInput struct {
	Session  *cache.Session
	Debug    bool
	Title    string
	Group    string
	Tasklist string
	UUID     string
}

func (*CompleteAdvancedTaskInput) Run

func (ci *CompleteAdvancedTaskInput) Run() error

type CompleteTaskInput

type CompleteTaskInput struct {
	Session  *cache.Session
	Debug    bool
	Title    string
	Tasklist string
	UUID     string
}

func (*CompleteTaskInput) Run

func (ci *CompleteTaskInput) Run() error

type ContentAnalyzer

type ContentAnalyzer struct {
	// contains filtered or unexported fields
}

ContentAnalyzer performs content analysis on notes to discover themes.

func NewContentAnalyzer

func NewContentAnalyzer(notes items.Items) *ContentAnalyzer

NewContentAnalyzer creates a content analyzer.

func (*ContentAnalyzer) AnalyzeContent

func (ca *ContentAnalyzer) AnalyzeContent() []ContentTheme

AnalyzeContent performs comprehensive content analysis.

type ContentTheme

type ContentTheme struct {
	Name         string
	Keywords     []string
	Phrases      []string
	NoteCount    int
	Relevance    float64
	RelatedNotes []string // Note UUIDs
}

ContentTheme represents a discovered theme from content analysis.

type CreateItemsKeyInput

type CreateItemsKeyInput struct {
	Debug     bool
	MasterKey string
}

type DecryptStringInput

type DecryptStringInput struct {
	Session   session.Session
	In        string
	UseStdOut bool
	Key       string
}

type DefaultSection

type DefaultSection struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type DeleteAdvancedChecklistTaskInput

type DeleteAdvancedChecklistTaskInput struct {
	Session   *cache.Session
	Debug     bool
	Title     string
	Group     string
	Checklist string
	UUID      string
}

func (*DeleteAdvancedChecklistTaskInput) Run

type DeleteItemConfig

type DeleteItemConfig struct {
	Session    *cache.Session
	NoteTitles []string
	NoteText   string
	ItemsUUIDs []string
	Regex      bool
	Debug      bool
}

func (*DeleteItemConfig) Run

func (i *DeleteItemConfig) Run() (int, error)

type DeleteNoteConfig

type DeleteNoteConfig struct {
	Session    *cache.Session
	NoteTitles []string
	NoteText   string
	NoteUUIDs  []string
	Regex      bool
	Debug      bool
}

func (*DeleteNoteConfig) Run

func (i *DeleteNoteConfig) Run() (int, error)

type DeleteTagConfig

type DeleteTagConfig struct {
	Session   *cache.Session
	Email     string
	TagTitles []string
	TagUUIDs  []string
	Regex     bool
	Debug     bool
}

func (*DeleteTagConfig) Run

func (i *DeleteTagConfig) Run() (int, error)

type DeleteTaskInput

type DeleteTaskInput struct {
	Session  *cache.Session
	Debug    bool
	Title    string
	Tasklist string
	UUID     string
}

func (*DeleteTaskInput) Run

func (ci *DeleteTaskInput) Run() error

type EncryptedItemExport

type EncryptedItemExport struct {
	UUID        string `json:"uuid"`
	ItemsKeyID  string `json:"items_key_id,omitempty"`
	Content     string `json:"content"`
	ContentType string `json:"content_type"`
	// Deleted            bool    `json:"deleted"`
	EncItemKey         string  `json:"enc_item_key"`
	CreatedAt          string  `json:"created_at"`
	UpdatedAt          string  `json:"updated_at"`
	CreatedAtTimestamp int64   `json:"created_at_timestamp"`
	UpdatedAtTimestamp int64   `json:"updated_at_timestamp"`
	DuplicateOf        *string `json:"duplicate_of"`
}

type EncryptedItemsFile

type EncryptedItemsFile struct {
	Items items.EncryptedItems `json:"items"`
}

type ExportConfig

type ExportConfig struct {
	Session   *cache.Session
	Decrypted bool
	File      string
	UseStdOut bool
}

type ExportEnhancedConfig

type ExportEnhancedConfig struct {
	Session        *cache.Session
	OutputDir      string
	Format         ExportFormat
	ByTags         bool
	WithMetadata   bool
	StaticSite     string // hugo, jekyll, or empty
	IncludeTrashed bool
	Debug          bool
}

ExportEnhancedConfig holds enhanced export configuration

func (*ExportEnhancedConfig) Run

func (e *ExportEnhancedConfig) Run() error

Run executes the enhanced export

type ExportFormat

type ExportFormat string

ExportFormat represents export format type

const (
	FormatMarkdown ExportFormat = "markdown"
	FormatHTML     ExportFormat = "html"
	FormatJSON     ExportFormat = "json"
)

type ExportedNote

type ExportedNote struct {
	Title     string   `json:"title"`
	Content   string   `json:"content"`
	UUID      string   `json:"uuid"`
	Tags      []string `json:"tags"`
	CreatedAt string   `json:"created_at"`
	UpdatedAt string   `json:"updated_at"`
	Trashed   bool     `json:"trashed,omitempty"`
}

ExportedNote represents a note for export with metadata

type GeminiResponse

type GeminiResponse struct {
	Title     string   `json:"title"`      // Proposed title (empty if no change)
	Tags      []string `json:"tags"`       // Proposed tags
	Reasoning string   `json:"reasoning"`  // Explanation of changes
	CreateNew []string `json:"create_new"` // New tags that need creation
}

GeminiResponse is the structured response from Gemini API.

type GetItemsConfig

type GetItemsConfig struct {
	Session *cache.Session
	Filters items.ItemFilters
	Output  string
	Debug   bool
}

func (*GetItemsConfig) Run

func (i *GetItemsConfig) Run() (items.Items, error)

type GetNoteConfig

type GetNoteConfig struct {
	Session    *cache.Session
	Filters    items.ItemFilters
	NoteTitles []string
	TagTitles  []string
	TagUUIDs   []string
	PageSize   int
	BatchSize  int
	Debug      bool
}

func (*GetNoteConfig) Run

func (i *GetNoteConfig) Run() (items.Items, error)

type GetSettingsConfig

type GetSettingsConfig struct {
	Session *cache.Session
	Filters items.ItemFilters
	Output  string
	Debug   bool
}

func (*GetSettingsConfig) Run

func (i *GetSettingsConfig) Run() (items.Items, error)

type GetTagConfig

type GetTagConfig struct {
	Session *cache.Session
	Filters items.ItemFilters
	Output  string
	Debug   bool
}

func (*GetTagConfig) Run

func (i *GetTagConfig) Run() (items.Items, error)

type ImportConfig

type ImportConfig struct {
	Session   *cache.Session
	File      string
	Format    string
	UseStdOut bool
	Debug     bool
}

type ItemOrphanedRefs

type ItemOrphanedRefs struct {
	ContentType  string
	Item         items.Item
	OrphanedRefs []string
}

type ItemReferenceJSON

type ItemReferenceJSON struct {
	UUID          string `json:"uuid"`
	ContentType   string `json:"content_type"`
	ReferenceType string `json:"reference_type,omitempty"`
}

func ItemRefsToJSON

func ItemRefsToJSON(irs []items.ItemReference) []ItemReferenceJSON

type ItemReferenceYAML

type ItemReferenceYAML struct {
	UUID          string `yaml:"uuid"`
	ContentType   string `yaml:"content_type"`
	ReferenceType string `yaml:"reference_type,omitempty"`
}

func ItemRefsToYaml

func ItemRefsToYaml(irs []items.ItemReference) []ItemReferenceYAML

type ItemsKeysHealthcheckInput

type ItemsKeysHealthcheckInput struct {
	Session       session.Session
	UseStdOut     bool
	DeleteInvalid bool
}

type LinkStyle

type LinkStyle string

LinkStyle defines how links are formatted.

const (
	LinkStyleWikilink LinkStyle = "wikilink"
	LinkStyleMarkdown LinkStyle = "markdown"
	LinkStyleRelative LinkStyle = "relative"
)

type ListChecklistsInput

type ListChecklistsInput struct {
	Session *cache.Session
	Debug   bool
}

type ListTasklistsInput

type ListTasklistsInput struct {
	Session  *cache.Session
	Ordering string
	Debug    bool
}

func (*ListTasklistsInput) Run

func (ci *ListTasklistsInput) Run() error

type MOCBuilder

type MOCBuilder struct {
	// contains filtered or unexported fields
}

MOCBuilder builds Maps of Content from notes.

func NewMOCBuilder

func NewMOCBuilder(notes items.Items, config MOCConfig) *MOCBuilder

NewMOCBuilder creates a new MOC builder.

func (*MOCBuilder) Generate

func (mb *MOCBuilder) Generate() ([]MOCFile, error)

Generate generates MOC files based on the configured style.

type MOCConfig

type MOCConfig struct {
	Style          MOCStyle
	MaxDepth       int
	MinNotesPerMOC int
	IncludeStats   bool
	IncludeRecent  bool
	RecentCount    int
}

MOCConfig holds MOC generation configuration.

type MOCFile

type MOCFile struct {
	Filename string
	Title    string
	Content  string
	Tags     []string
	Order    int
}

MOCFile represents a generated Map of Content file.

type MOCStyle

type MOCStyle string

MOCStyle represents different MOC organization styles.

const (
	MOCStyleFlat         MOCStyle = "flat"
	MOCStyleHierarchical MOCStyle = "hierarchical"
	MOCStylePARA         MOCStyle = "para"
	MOCStyleTopicBased   MOCStyle = "topic"
	MOCStyleAuto         MOCStyle = "auto"
)

type MigrateConfig

type MigrateConfig struct {
	Session      *cache.Session
	Provider     string
	OutputDir    string
	GenerateMOCs bool
	MOCStyle     MOCStyle
	MOCDepth     int
	TagFilter    []string
	DryRun       bool
	Debug        bool
}

MigrateConfig holds configuration for migration operations.

func (*MigrateConfig) Run

func (m *MigrateConfig) Run() (*MigrationResult, error)

Run executes the migration.

func (*MigrateConfig) Validate

func (m *MigrateConfig) Validate() error

Validate checks if the migration configuration is valid.

type MigrationExportConfig

type MigrationExportConfig struct {
	OutputDir    string
	PreserveUUID bool
	LinkStyle    LinkStyle
	TagStyle     TagStyle
	DryRun       bool
	Debug        bool
}

MigrationExportConfig holds provider-specific export configuration.

type MigrationResult

type MigrationResult struct {
	NotesExported int
	MOCsCreated   int
	TagsProcessed int
	Duration      time.Duration
	OutputPath    string
	Warnings      []string
	Errors        []string
}

MigrationResult contains the results of a migration operation.

type NoteContentJSON

type NoteContentJSON struct {
	Title            string              `json:"title"`
	Text             string              `json:"text"`
	ItemReferences   []ItemReferenceJSON `json:"references"`
	AppData          AppDataContentJSON  `json:"appData"`
	EditorIdentifier string              `json:"editorIdentifier"`
	PreviewPlain     string              `json:"preview_plain"`
	PreviewHtml      string              `json:"preview_html"`
	Spellcheck       bool                `json:"spellcheck"`
	Trashed          *bool               `json:"trashed,omitempty"`
}

type NoteContentYAML

type NoteContentYAML struct {
	Title            string              `yaml:"title"`
	Text             string              `json:"text"`
	ItemReferences   []ItemReferenceYAML `yaml:"references"`
	AppData          AppDataContentYAML  `yaml:"appData"`
	EditorIdentifier string              `yaml:"editorIdentifier"`
	PreviewPlain     string              `yaml:"preview_plain"`
	PreviewHtml      string              `yaml:"preview_html"`
	Spellcheck       bool                `yaml:"spellcheck"`
	Trashed          *bool               `yaml:"trashed,omitempty"`
}

type NoteJSON

type NoteJSON struct {
	UUID        string          `json:"uuid"`
	Content     NoteContentJSON `json:"content"`
	ContentType string          `json:"content_type"`
	CreatedAt   string          `json:"created_at"`
	UpdatedAt   string          `json:"updated_at"`
}

type NoteYAML

type NoteYAML struct {
	UUID        string          `yaml:"uuid"`
	Content     NoteContentYAML `yaml:"content"`
	ContentType string          `yaml:"content_type"`
	CreatedAt   string          `yaml:"created_at"`
	UpdatedAt   string          `yaml:"updated_at"`
}

type ObsidianExporter

type ObsidianExporter struct {
	// contains filtered or unexported fields
}

ObsidianExporter implements the Provider interface for Obsidian.

func NewObsidianExporter

func NewObsidianExporter(outputDir string) *ObsidianExporter

NewObsidianExporter creates a new Obsidian exporter.

func (*ObsidianExporter) Export

func (o *ObsidianExporter) Export(notes items.Items, config MigrationExportConfig) error

Export exports notes to Obsidian format.

func (*ObsidianExporter) GenerateMOCs

func (o *ObsidianExporter) GenerateMOCs(notes items.Items, config MOCConfig) ([]MOCFile, error)

GenerateMOCs generates Maps of Content for the exported notes.

func (*ObsidianExporter) Name

func (o *ObsidianExporter) Name() string

Name returns the provider name.

func (*ObsidianExporter) Validate

func (o *ObsidianExporter) Validate() error

Validate checks if the exporter configuration is valid.

type OrgStandardNotesSNComponentsDetailJSON

type OrgStandardNotesSNComponentsDetailJSON map[string]interface{}

type OrgStandardNotesSNDetailJSON

type OrgStandardNotesSNDetailJSON struct {
	ClientUpdatedAt    string `json:"client_updated_at"`
	PrefersPlainEditor bool   `json:"prefersPlainEditor"`
	Pinned             bool   `json:"pinned"`
}

type OrgStandardNotesSNDetailYAML

type OrgStandardNotesSNDetailYAML struct {
	ClientUpdatedAt string `yaml:"client_updated_at"`
}

type OrganizeConfig

type OrganizeConfig struct {
	Session   *cache.Session
	GeminiKey string
	Since     string   // Date filter (RFC3339 format)
	Until     string   // Date filter (RFC3339 format)
	UUIDs     []string // Specific note UUIDs to process
	Titles    []string // Specific note titles to process
	AutoApply bool     // Skip confirmation prompt
	Debug     bool
}

OrganizeConfig holds configuration for the organize operation.

func (*OrganizeConfig) Run

func (i *OrganizeConfig) Run() (OrganizeOutput, error)

Run executes the organize operation and returns proposed changes.

type OrganizeOutput

type OrganizeOutput struct {
	Changes      []ProposedChange
	Applied      bool
	NotesUpdated int
	TagsCreated  []string
}

OrganizeOutput contains results of the organize operation.

type OutputSessionInput

type OutputSessionInput struct {
	Session         session.Session
	In              string
	UseStdOut       bool
	OutputMasterKey bool
}

type ProposedChange

type ProposedChange struct {
	NoteUUID     string
	NoteTitle    string
	NewTitle     string
	TitleChanged bool
	ExistingTags []string
	ProposedTags []string
	TagsChanged  bool
	Reason       string // AI's reasoning for changes
}

ProposedChange represents a single note's proposed modifications.

type Provider

type Provider interface {
	Name() string
	Validate() error
	Export(notes items.Items, config MigrationExportConfig) error
	GenerateMOCs(notes items.Items, mocConfig MOCConfig) ([]MOCFile, error)
}

Provider interface defines operations for different export targets.

type RegisterConfig

type RegisterConfig struct {
	Email     string
	Password  string
	APIServer string
	Debug     bool
}

func (*RegisterConfig) Run

func (i *RegisterConfig) Run() error

type ReopenAdvancedTaskInput

type ReopenAdvancedTaskInput struct {
	Session  *cache.Session
	Debug    bool
	UUID     string
	Title    string
	Group    string
	Tasklist string
}

func (*ReopenAdvancedTaskInput) Run

func (ci *ReopenAdvancedTaskInput) Run() error

type ReopenTaskInput

type ReopenTaskInput struct {
	Session  *cache.Session
	Debug    bool
	UUID     string
	Title    string
	Tasklist string
}

func (*ReopenTaskInput) Run

func (ci *ReopenTaskInput) Run() error

type RestoreConfig

type RestoreConfig struct {
	Session   *cache.Session
	InputFile string
	DryRun    bool
	Password  string
	Debug     bool
}

RestoreConfig holds restore configuration

func (*RestoreConfig) Run

func (r *RestoreConfig) Run() (RestoreResult, error)

Run executes the restore

type RestoreResult

type RestoreResult struct {
	DryRun     bool
	Manifest   BackupManifest
	NotesCount int
	TagsCount  int
}

RestoreResult contains the result of a restore operation

type SettingContentJSON

type SettingContentJSON struct {
	Title          string              `json:"title"`
	ItemReferences []ItemReferenceJSON `json:"references"`
	AppData        AppDataContentJSON  `json:"appData"`
}

type SettingContentYAML

type SettingContentYAML struct {
	Title          string              `yaml:"title"`
	ItemReferences []ItemReferenceYAML `yaml:"references"`
	AppData        AppDataContentYAML  `yaml:"appData"`
}

type SettingJSON

type SettingJSON struct {
	UUID        string             `json:"uuid"`
	Content     SettingContentJSON `json:"content"`
	ContentType string             `json:"content_type"`
	CreatedAt   string             `json:"created_at"`
	UpdatedAt   string             `json:"updated_at"`
}

type SettingYAML

type SettingYAML struct {
	UUID        string             `yaml:"uuid"`
	Content     SettingContentYAML `yaml:"content"`
	ContentType string             `yaml:"content_type"`
	CreatedAt   string             `yaml:"created_at"`
	UpdatedAt   string             `yaml:"updated_at"`
}

type ShowChecklistInput

type ShowChecklistInput struct {
	Session *cache.Session
	Title   string
	UUID    string
	Debug   bool
}

type ShowTasklistInput

type ShowTasklistInput struct {
	Session       *cache.Session
	Debug         bool
	Group         string
	Title         string
	UUID          string
	ShowCompleted bool
	Ordering      string
}

func (*ShowTasklistInput) Run

func (ci *ShowTasklistInput) Run() error

type StatsConfig

type StatsConfig struct {
	Session cache.Session
}

func (*StatsConfig) GetData

func (i *StatsConfig) GetData() (StatsData, error)

func (*StatsConfig) Run

func (i *StatsConfig) Run() error

type StatsData

type StatsData struct {
	CoreTypeCounter   typeCounter
	OtherTypeCounter  typeCounter
	LargestNotes      []*items.Note
	ItemsOrphanedRefs []ItemOrphanedRefs
	LastUpdatedNote   *items.Note
	NewestNote        *items.Note
	OldestNote        *items.Note
	DuplicateNotes    []*items.Note
}

type TagContentJSON

type TagContentJSON struct {
	Title          string              `json:"title"`
	ItemReferences []ItemReferenceJSON `json:"references"`
	AppData        AppDataContentJSON  `json:"appData"`
}

type TagContentYAML

type TagContentYAML struct {
	Title          string              `yaml:"title"`
	ItemReferences []ItemReferenceYAML `yaml:"references"`
	AppData        AppDataContentYAML  `yaml:"appData"`
}

type TagItemsConfig

type TagItemsConfig struct {
	Session    *cache.Session
	FindTitle  string
	FindText   string
	FindTag    string
	NewTags    []string
	Replace    bool
	IgnoreCase bool
	Debug      bool
}

func (*TagItemsConfig) Run

func (i *TagItemsConfig) Run() error

type TagJSON

type TagJSON struct {
	UUID        string         `json:"uuid"`
	Content     TagContentJSON `json:"content"`
	ContentType string         `json:"content_type"`
	CreatedAt   string         `json:"created_at"`
	UpdatedAt   string         `json:"updated_at"`
}

type TagStyle

type TagStyle string

TagStyle defines where tags appear in exported notes.

const (
	TagStyleFrontmatter TagStyle = "frontmatter"
	TagStyleInline      TagStyle = "inline"
	TagStyleBoth        TagStyle = "both"
)

type TagYAML

type TagYAML struct {
	UUID        string         `yaml:"uuid"`
	Content     TagContentYAML `yaml:"content"`
	ContentType string         `yaml:"content_type"`
	CreatedAt   string         `yaml:"created_at"`
	UpdatedAt   string         `yaml:"updated_at"`
}

type Template

type Template struct {
	Name        string            `yaml:"name"`
	Description string            `yaml:"description"`
	Title       string            `yaml:"title"`
	Content     string            `yaml:"content"`
	Tags        []string          `yaml:"tags"`
	Variables   map[string]string `yaml:"variables"`
}

Template represents a note template

func GetTemplate

func GetTemplate(name string, templateDir string) (Template, error)

GetTemplate retrieves a template by name (built-in or custom)

func ListTemplates

func ListTemplates(templateDir string) []Template

ListTemplates returns all available templates

type TemplateConfig

type TemplateConfig struct {
	TemplateDir string
	Variables   map[string]string
}

TemplateConfig holds template processing configuration

type TestDataCreateNotesConfig

type TestDataCreateNotesConfig struct {
	Session  cache.Session
	NumNotes int
	NumParas int
	Debug    bool
}

func (*TestDataCreateNotesConfig) Run

type TestDataCreateTagsConfig

type TestDataCreateTagsConfig struct {
	Session session.Session
	NumTags int64
	Debug   bool
}

func (*TestDataCreateTagsConfig) Run

type WipeConfig

type WipeConfig struct {
	Session    *cache.Session
	UseStdOut  bool
	Debug      bool
	Everything bool
}

func (*WipeConfig) Run

func (i *WipeConfig) Run() (int, error)

Jump to

Keyboard shortcuts

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