Skip to content

sugarcraft/sugar-glow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

49 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

sugar-glow

SugarGlow

CI codecov Packagist Version License PHP

demo

PHP port of charmbracelet/glow β€” a Markdown CLI viewer that composes CandyShine (rendering) and SugarBits Viewport (scrolling).

composer require sugarcraft/sugar-glow

CLI

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

Flags:

  • --theme {ansi|plain|dark|light|notty|dracula|tokyo-night|pink} β€” picks a CandyShine preset.
  • --style / -s β€” alias for --theme (glamour-compat).
  • --theme-config <path> β€” load a custom JSON theme via Theme::fromJson. Overrides --theme.
  • --width / -w <N> β€” word-wrap paragraphs / blockquotes / list bodies. 0 = no wrap.
  • --no-hyperlinks β€” disable OSC 8 link envelopes; render links as text (url) instead.
  • --pager / -p β€” open in a fullscreen pager.

Pager keys

Standard reader keys come from Viewport:

Key Action
↑ / k line up
↓ / j line down
PgUp / b page up
PgDn / space / f page down
Ctrl+U / Ctrl+D half page
Home / g top
End / G bottom
q / Esc / Ctrl+C exit

Test

cd sugar-glow && composer install && vendor/bin/phpunit

About

πŸŒ™ PHP port of ✨ glow β€” Markdown CLI viewer/pager composing CandyShine + SugarBits Viewport with 8 themes & OSC 8 link support.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages