Documentation
¶
Overview ¶
Package preview fetches a remote pCloud file and renders it for display in a terminal viewport. Supported formats:
- Markdown (.md, .markdown) → goldmark + chroma renderer
- Source code (.go, .py, .js, .ts, …) → chroma syntax highlight
- Plain text (.txt, .log) → raw, no highlight
- PDF (.pdf) → ledongthuc/pdf text extraction
- Images (.jpg, .png, .gif, .bmp, .webp) → image2ascii colored ASCII art
- CSV (.csv) → aligned text table
- XML (.xml) → chroma syntax highlight
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanPreview ¶
CanPreview reports whether the given filename has a supported preview format.
func Render ¶
Render renders raw file bytes to a string for terminal display. name is used purely for extension-based format detection. width and height are the available viewport dimensions; a 2-column border offset is subtracted from width here so all renderers stay within bounds.
func RenderFromURL ¶
RenderFromURL downloads the file at downloadURL and renders its content to a string suitable for display inside a bubbletea viewport. name is the original filename (used for format detection). width and height define the target terminal dimensions.
Types ¶
This section is empty.