Documentation
¶
Index ¶
Constants ¶
const MinWidth = 60
MinWidth is the minimum usable width for the application.
Variables ¶
This section is empty.
Functions ¶
func IsMarkdownFile ¶ added in v0.2.1
IsMarkdownFile reports whether name has a markdown extension (case-insensitive).
Types ¶
type Book ¶
type Book struct {
// contains filtered or unexported fields
}
Book is the file browser view.
func NewBook ¶
func NewBook(ctx *ViewContext, dir string) Book
NewBook creates a new Book file browser for the given directory.
func NewBookFromFiles ¶
func NewBookFromFiles(ctx *ViewContext, files []string) Book
NewBookFromFiles creates a Book view from explicit file/directory paths instead of scanning a directory. Used when ink is called with multiple args.
type Chapter ¶
type Chapter struct {
// contains filtered or unexported fields
}
Chapter is the markdown viewer.
func NewChapter ¶
func NewChapter(ctx *ViewContext, filePath string) Chapter
NewChapter creates a new Chapter viewer for the given file.
type CloseEditorMsg ¶
type CloseEditorMsg struct {
FilePath string
}
CloseEditorMsg signals the editor has closed.
type Editor ¶
type Editor struct {
// contains filtered or unexported fields
}
Editor is the distraction-free markdown editor.
type ExternalEditorClosedMsg ¶
type ExternalEditorClosedMsg struct {
Err error
}
ExternalEditorClosedMsg signals the external editor has exited.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the root application model that routes between views.
func NewFromFile ¶
NewFromFile creates a model that opens a single markdown file directly in ChapterView. Pressing back/esc quits the app instead of returning to BookView.
func NewFromFiles ¶
NewFromFiles creates a model that shows a filtered BookView with the given file/dir paths.
type OpenChapterMsg ¶
type OpenChapterMsg struct {
FilePath string
}
OpenChapterMsg requests switching to the Chapter view for the given file.
type OpenEditorMsg ¶
OpenEditorMsg requests switching to the Editor view.
type OpenExternalEditorMsg ¶
type OpenExternalEditorMsg struct {
FilePath string
}
OpenExternalEditorMsg requests opening the file in $EDITOR.
type ViewContext ¶ added in v0.2.0
type ViewContext struct {
// contains filtered or unexported fields
}
ViewContext holds shared state across all views.