Markdown CLI viewer + pager
Composes CandyShine (rendering) and SugarBits Viewport (scrolling). Render to stdout or open in a fullscreen pager. Eleven built-in themes (ansi, plain, dark, light, notty, dracula, tokyo-night, pink, solarized, monokai, github) plus custom JSON.
composer require sugarcraft/sugar-glow
sugarglow README.md # render to stdout (default)
sugarglow -p README.md # open in a fullscreen pager
git log -1 --pretty=%B | sugarglow -p # pipe stdin
sugarglow --theme dracula README.md
sugarglow --width 80 --no-hyperlinks README.md
sugarglow --theme-config ./my-theme.json README.md
sugarglow README.md โ pipe-friendly, exits clean.-p / --pager โ fullscreen scrollable Viewport. Esc / q to exit.--theme {ansi|plain|dark|light|notty|dracula|tokyo-night|pink|solarized|monokai|github}, --theme-config ./my.json, -s alias for glamour-compat. Three themes (solarized/monokai/github) load from JSON in themes/.-w 80 โ column width control. 0 disables.--no-hyperlinks falls back to text (url) rendering.git log -1 --pretty=%B | sugarglow -p.| Class | Method | Description |
|---|---|---|
| GlamourTheme | fromJson(json) | Parse a Glamour theme JSON string |
| GlamourTheme | fromFile(path) | Load a Glamour theme from a JSON file |
| GlamourTheme | resolve(token) | Resolve a chroma token to its SGR color |
| FileWatcher | hasChangedSince(mtime) | Check if file modified since given mtime |
| FileWatcher | watch(path, intervalMs) | Generator watching a file for changes (mtime polling) |
| WidthHelper | visualWidth(text) | Visual width accounting for CJK/emoji |
| WidthHelper | padRight(text, width) | Pad string to fixed visual width |
| WidthHelper | slice(text, start, end) | Slice string by visual width offsets |
| WidthHelper | isFullWidth(char) | Check if character is full-width |
| WidthHelper | truncate(text, maxWidth) | Truncate string to max visual width |
VHS-recorded GIFs of every example shipped with the library. Regenerated automatically on every push that touches the source.