Documentation
¶
Overview ¶
Package tui implements chunder's terminal user interface: a Bubble Tea download experience with Lip Gloss styling, gradients, and live progress.
Index ¶
- Constants
- func AccentText(s string) string
- func Badge(text, bg string) string
- func Banner() string
- func DimText(s string) string
- func ErrorText(s string) string
- func GradientText(s, from, to string) string
- func RenderInfo(video *youtube.Video) string
- func RunClip(ctx context.Context, client *downloader.Client, opts downloader.Options) error
- func RunDownload(ctx context.Context, client *downloader.Client, opts downloader.Options) error
- func RunPlaylist(ctx context.Context, client *downloader.Client, opts downloader.Options, ...) error
- func RunSearch(ctx context.Context, query string, results []search.Result) (string, search.Result, error)
- func RunWatch(ctx context.Context, params WatchParams) error
- func Sparkline(values []float64, width int) string
- func Wordmark() string
- type WatchParams
Constants ¶
const ( ActionNone = "" ActionDownload = "download" ActionAudio = "audio" ActionWatch = "watch" )
Search actions the user can pick from the results browser.
Variables ¶
This section is empty.
Functions ¶
func Banner ¶
func Banner() string
Banner returns the logo with a vertical pink→amber gradient plus tagline.
func GradientText ¶
GradientText colors s with a horizontal gradient from one hex color to another.
func RenderInfo ¶
RenderInfo returns the full styled output for `chunder info`: a video card followed by a table of every available stream.
func RunClip ¶
func RunClip(ctx context.Context, client *downloader.Client, opts downloader.Options) error
RunClip extracts a clip segment inside the interactive TUI.
func RunDownload ¶
func RunDownload(ctx context.Context, client *downloader.Client, opts downloader.Options) error
RunDownload executes a download inside the interactive TUI. It blocks until the download finishes, fails, or the user cancels.
func RunPlaylist ¶
func RunPlaylist(ctx context.Context, client *downloader.Client, opts downloader.Options, plOpts downloader.PlaylistOptions) error
RunPlaylist downloads a whole playlist inside the interactive TUI.
func RunSearch ¶
func RunSearch(ctx context.Context, query string, results []search.Result) (string, search.Result, error)
RunSearch shows the interactive results browser and returns the action the user chose and for which video. action is ActionNone if they just quit.
func RunWatch ¶
func RunWatch(ctx context.Context, params WatchParams) error
RunWatch plays a video inside the terminal until it ends or the user quits.