interactive

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EditText

func EditText(initialContent, title string) (string, bool, error)

EditText opens an editor for text content

func EditWithExternalEditor

func EditWithExternalEditor(initialContent string) (string, error)

EditWithExternalEditor opens the given text in an external editor

func SimpleEditText

func SimpleEditText(initialContent string) (string, bool, error)

SimpleEditText opens a simple editor for text editing

Types

type Editor

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

Editor provides a terminal-based text editor using tview

func NewEditor

func NewEditor(initialContent string, title string) *Editor

NewEditor creates and initializes a new Editor

func (*Editor) Run

func (e *Editor) Run() (string, bool, error)

Run starts the editor and returns the edited content

type Prompter

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

Prompter handles interactive CLI prompts

func NewPrompter

func NewPrompter() *Prompter

NewPrompter creates a new Prompter

func (*Prompter) AskCategory

func (p *Prompter) AskCategory() (models.Category, error)

AskCategory prompts the user to select a category

func (*Prompter) AskProgramTitle

func (p *Prompter) AskProgramTitle() (string, error)

AskProgramTitle prompts for what program was written

func (*Prompter) AskResearchTopic

func (p *Prompter) AskResearchTopic() (string, error)

AskResearchTopic prompts for what was researched

func (*Prompter) AskSatisfaction

func (p *Prompter) AskSatisfaction() (int, error)

AskSatisfaction prompts for satisfaction level (1-5)

func (*Prompter) AskString

func (p *Prompter) AskString() (string, error)

AskString prompts for a string input

func (*Prompter) CheckForQuit

func (p *Prompter) CheckForQuit(input string) bool

CheckForQuit checks if input indicates a desire to quit

func (*Prompter) EditEntry

func (p *Prompter) EditEntry(entry *models.Entry) error

EditEntry prompts the user to edit the entry content interactively with a TUI editor

func (*Prompter) ShowSealMessage

func (p *Prompter) ShowSealMessage(satisfaction int)

ShowSealMessage displays the seal's encouragement message

type SimpleEditor

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

SimpleEditor is a basic console-based text editor

func NewSimpleEditor

func NewSimpleEditor(initialContent string) (*SimpleEditor, error)

NewSimpleEditor creates a new SimpleEditor with the initial content

func (*SimpleEditor) Run

func (e *SimpleEditor) Run() (string, bool, error)

Run starts the editor and returns the edited content

Jump to

Keyboard shortcuts

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