cli

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2021 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	Version        string
	Config         core.Config
	Logger         *util.ProxyLogger
	Terminal       *term.Terminal
	FS             *fs.FileStorage
	TemplateLoader core.TemplateLoader
	WorkingDir     string
	Notebooks      *core.NotebookStore
	// contains filtered or unexported fields
}

func NewContainer

func NewContainer(version string) (*Container, error)

func (*Container) CurrentNotebook

func (c *Container) CurrentNotebook() (*core.Notebook, error)

CurrentNotebook returns the current default notebook.

func (*Container) NewNoteEditor

func (c *Container) NewNoteEditor(notebook *core.Notebook) (*editor.Editor, error)

func (*Container) NewNoteFilter

func (c *Container) NewNoteFilter(opts fzf.NoteFilterOpts) *fzf.NoteFilter

func (*Container) Paginate

func (c *Container) Paginate(noPager bool, run func(out io.Writer) error) error

Paginate creates an auto-closing io.Writer which will be automatically paginated if noPager is false, using the user's pager.

You can write to the pager only in the run callback.

func (*Container) SetCurrentNotebook

func (c *Container) SetCurrentNotebook(searchDirs []Dirs) error

SetCurrentNotebook sets the first notebook found in the given search paths as the current default one.

type Dirs

type Dirs struct {
	NotebookDir string
	WorkingDir  string
}

type Filtering

type Filtering struct {
	Path []string `group:filter arg optional placeholder:PATH help:"Find notes matching the given path, including its descendants."`

	Interactive    bool     `group:filter short:i                     help:"Select notes interactively with fzf."`
	Limit          int      `group:filter short:n   placeholder:COUNT help:"Limit the number of notes found."`
	Match          string   `group:filter short:m   placeholder:QUERY help:"Terms to search for in the notes."`
	ExactMatch     bool     `group:filter short:e                     help:"Search for exact occurrences of the --match argument (case insensitive)."`
	Exclude        []string `group:filter short:x   placeholder:PATH  help:"Ignore notes matching the given path, including its descendants."`
	Tag            []string `group:filter short:t                     help:"Find notes tagged with the given tags."`
	Mention        []string `group:filter           placeholder:PATH  help:"Find notes mentioning the title of the given ones."`
	MentionedBy    []string `group:filter           placeholder:PATH  help:"Find notes whose title is mentioned in the given ones."`
	LinkTo         []string `group:filter short:l   placeholder:PATH  help:"Find notes which are linking to the given ones."`
	NoLinkTo       []string `group:filter           placeholder:PATH  help:"Find notes which are not linking to the given notes."`
	LinkedBy       []string `group:filter short:L   placeholder:PATH  help:"Find notes which are linked by the given ones."`
	NoLinkedBy     []string `group:filter           placeholder:PATH  help:"Find notes which are not linked by the given ones."`
	Orphan         bool     `group:filter                             help:"Find notes which are not linked by any other note."`
	Related        []string `group:filter           placeholder:PATH  help:"Find notes which might be related to the given ones."`
	MaxDistance    int      `group:filter           placeholder:COUNT help:"Maximum distance between two linked notes."`
	Recursive      bool     `group:filter short:r                     help:"Follow links recursively."`
	Created        string   `group:filter           placeholder:DATE  help:"Find notes created on the given date."`
	CreatedBefore  string   `group:filter           placeholder:DATE  help:"Find notes created before the given date."`
	CreatedAfter   string   `group:filter           placeholder:DATE  help:"Find notes created after the given date."`
	Modified       string   `group:filter           placeholder:DATE  help:"Find notes modified on the given date."`
	ModifiedBefore string   `group:filter           placeholder:DATE  help:"Find notes modified before the given date."`
	ModifiedAfter  string   `group:filter           placeholder:DATE  help:"Find notes modified after the given date."`

	Sort []string `group:sort short:s placeholder:TERM help:"Order the notes by the given criterion."`
}

Filtering holds filtering options to select notes.

func (Filtering) ExpandNamedFilters

func (f Filtering) ExpandNamedFilters(filters map[string]string, expandedFilters []string) (Filtering, error)

ExpandNamedFilters expands recursively any named filter found in the Path field.

func (Filtering) NewNoteFindOpts

func (f Filtering) NewNoteFindOpts(notebook *core.Notebook) (core.NoteFindOpts, error)

NewNoteFindOpts creates an instance of core.NoteFindOpts from a set of user flags.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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