Documentation
¶
Overview ¶
Package yedit provides reusable building blocks for TUI editors over structured YAML files.
The library is composed of independent sub-packages:
- schema: reflection over the client's Go structs (yaml tag required; validate and jsonschema_description optional)
- document: YAML state with block-level mutations, history, and parsing
- editor: two-panel bubbletea TUI that ties the pieces together
- presets: Source interface + fs.FS-backed implementation for per-field YAML snippets
- viewer: read-only TUI to browse a preset Source
- theme: palette and layout primitives (header, panels, two-column layout)
- components: bubbletea widgets (alert) that depend only on theme
yedit is intentionally headless of any specific YAML schema. Clients pass a pointer to their own annotated struct and (optionally) a preset Source; the editor introspects the struct via the schema package and renders an add/edit/remove UI keyed by the canonical top-level order.
See editor.Run and editor.Config for the main entry point.
Directories
¶
| Path | Synopsis |
|---|---|
|
components
|
|
|
alert
Package alert provides a modal alert/confirm component for bubbletea TUIs.
|
Package alert provides a modal alert/confirm component for bubbletea TUIs. |
|
Package document provides primitives for editing YAML files structured as a flat mapping of top-level keys ("blocks").
|
Package document provides primitives for editing YAML files structured as a flat mapping of top-level keys ("blocks"). |
|
Package editor provides the bubbletea TUI for editing a YAML file driven by a struct-based schema and a preset source.
|
Package editor provides the bubbletea TUI for editing a YAML file driven by a struct-based schema and a preset source. |
|
examples
|
|
|
test
command
Command test is a self-contained yedit example that exercises every schema pattern and known edge case.
|
Command test is a self-contained yedit example that exercises every schema pattern and known edge case. |
|
Package presets defines the Source interface for per-field YAML presets and provides a filesystem-backed implementation.
|
Package presets defines the Source interface for per-field YAML presets and provides a filesystem-backed implementation. |
|
Package schema discovers the editable shape of a Go struct via reflection over yaml/validate/jsonschema tags.
|
Package schema discovers the editable shape of a Go struct via reflection over yaml/validate/jsonschema tags. |
|
Package theme provides the palette, base lipgloss styles, and shared layout primitives used across yedit-built TUIs.
|
Package theme provides the palette, base lipgloss styles, and shared layout primitives used across yedit-built TUIs. |
|
Package viewer is a read-only TUI that browses the presets exposed by a presets.Source.
|
Package viewer is a read-only TUI that browses the presets exposed by a presets.Source. |
Click to show internal directories.
Click to hide internal directories.