Markdown → ANSI renderer
Built on league/commonmark + CandySprinkles. Word-wrap, OSC 8 hyperlinks, syntax highlighting, eight built-in themes plus custom JSON themes.
composer require sugarcraft/candy-shine
use SugarCraft\Shine\{Renderer, Theme};
echo (new Renderer())->render(<<<MD
# Welcome
A few **bold** and _italic_ words, with `inline code` and a
[link](https://example.com).
- one
- two
- three
```php
echo "hello world";
```
MD);
// Custom theme
$theme = Theme::fromJson('./themes/my-theme.json');
echo (new Renderer($theme))->render($markdown);
Theme::fromJson('./my-theme.json') — element-keyed style overrides.--no-hyperlinks toggle for terminals that don't support them.| Class | Method | Description |
|---|---|---|
| Renderer | new(?Theme) | Create renderer with optional theme |
| Renderer | render(markdown) | Render markdown to ANSI string |
| Theme | fromJson(path) | Load theme from JSON file |
| Theme | ansi(), dark(), light(), dracula() | Built-in theme presets |
VHS-recorded GIFs of every example shipped with the library. Regenerated automatically on every push that touches the source.