di

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InternalEditTag = "quest-object-id"

Functions

func DefaultConfigLocation added in v0.4.0

func DefaultConfigLocation() string

Types

type Config

type Config struct {
	TodoFile    string   `mapstructure:"todo-file,omitempty"`
	DoneFile    string   `mapstructure:"done-file,omitempty"`
	KeepBackups int      `mapstructure:"backup"`
	Editor      string   `mapstructure:"editor,omitempty"`
	UnknownTags bool     `mapstructure:"unknown-tags,omitempty"`
	ClearOnDone []string `mapstructure:"clear-on-done,omitempty"`
	QuestScore  struct {
		MinPriority    string   `mapstructure:"min-priority,omitempty"`
		UrgencyTags    []string `mapstructure:"urgency-tags,omitempty"`
		UrgencyBegin   int      `mapstructure:"urgency-begin,omitempty"`
		UrgencyDefault string   `mapstructure:"urgency-default,omitempty"`
	} `mapstructure:"quest-score,omitempty"`
	Tracking struct {
		Tag               string   `mapstructure:"tag,omitempty"`
		IncludeTags       []string `mapstructure:"include-tags,omitempty"`
		TrimProjectPrefix bool     `mapstructure:"trim-project-prefix,omitempty"`
		TrimContextPrefix bool     `mapstructure:"trim-context-prefix,omitempty"`
	} `mapstructure:"tracking,omitempty"`
	Recurrence struct {
		RecTag           string `mapstructure:"rec-tag,omitempty"`
		DueTag           string `mapstructure:"due-tag,omitempty"`
		ThresholdTag     string `mapstructure:"threshold-tag,omitempty"`
		PreservePriority bool   `mapstructure:"preserve-priority,omitempty"`
	} `mapstructure:"recurrence,omitempty"`
	Notes struct {
		Tag      string `mapstructure:"tag,omitempty"`
		Dir      string `mapstructure:"dir,omitempty"`
		IdLength int    `mapstructure:"id-length,omitempty"`
	} `mapstructure:"notes,omitempty"`
	Styles      []StyleDef         `mapstructure:"styles"`
	DefaultView ViewDef            `mapstructure:"default-view,omitempty"`
	Views       map[string]ViewDef `mapstructure:"views,omitempty"`
	Macros      []MacroDef         `mapstructure:"macro,omitempty"`
	Tags        map[string]TagDef  `mapstructure:"tags,omitempty"`
	NowFunc     func() time.Time   `mapstructure:"now-func,omitempty"` // Manually set only in testing, but defaults to time.Now
}

func (Config) HumanizedTags

func (c Config) HumanizedTags() []string

func (Config) LineColors

func (c Config) LineColors() qprojection.ColorFunc

func (Config) TagColors

func (c Config) TagColors() map[string]qprojection.ColorFunc

func (Config) TagTypes

func (c Config) TagTypes() map[string]qselect.DType

type Container

type Container struct {
	ConfigFile string
	// contains filtered or unexported fields
}

func (*Container) Config

func (d *Container) Config() Config

func (*Container) DoneTxtRepo

func (d *Container) DoneTxtRepo() *todotxt.Repo

func (*Container) Editor

func (d *Container) Editor() Editor

func (*Container) NotesRepo added in v0.4.0

func (d *Container) NotesRepo() *todotxt.NotesRepo

func (*Container) Projector

func (d *Container) Projector(cmd *cobra.Command) qprojection.Projector

func (*Container) QuestScoreCalculator

func (d *Container) QuestScoreCalculator() qscore.Calculator

func (*Container) SetConfig

func (d *Container) SetConfig(c Config)

func (*Container) SetEditor

func (d *Container) SetEditor(e Editor)

func (*Container) SortCompiler

func (d *Container) SortCompiler() qsort.Compiler

func (*Container) TodoTxtRepo

func (d *Container) TodoTxtRepo() *todotxt.Repo

type Editor

type Editor interface {
	Edit(path string) error
}

type EditorFunc

type EditorFunc func(path string) error

func (EditorFunc) Edit

func (e EditorFunc) Edit(path string) error

type MacroDef

type MacroDef struct {
	Name       string   `mapstructure:"name,omitempty"`
	Query      string   `mapstructure:"query,omitempty"`
	InTypes    []string `mapstructure:"args,omitempty"`
	ResultType string   `mapstructure:"result,omitempty"`
	InjectIt   bool     `mapstructure:"inject-it,omitempty"`
}

func (MacroDef) InDTypes

func (m MacroDef) InDTypes() []qselect.DType

type StyleDef

type StyleDef struct {
	If string `mapstructure:"if,omitempty"`
	Fg string `mapstructure:"fg,omitempty"`
}

type TagDef

type TagDef struct {
	Type     string     `mapstructure:"type,omitempty"`
	Humanize bool       `mapstructure:"humanize,omitempty"`
	Styles   []StyleDef `mapstructure:"styles,omitempty"`
}

type ViewDef

type ViewDef struct {
	Description string   `mapstructure:"description,omitempty"`
	Query       string   `mapstructure:"query,omitempty"`
	Projection  []string `mapstructure:"projection,omitempty"`
	Sort        []string `mapstructure:"sort,omitempty"`
	Clean       []string `mapstructure:"clean,omitempty"`
	Limit       int      `mapstructure:"limit,omitempty"`
	Interactive bool     `mapstructure:"interactive,omitempty"`
	AddPrefix   string   `mapstructure:"add-prefix,omitempty"`
	AddSuffix   string   `mapstructure:"add-suffix,omitempty"`
}

Jump to

Keyboard shortcuts

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