CommonMark extension for shifting heading levels
- PHP 100%
| src | ||
| .gitignore | ||
| composer.json | ||
| LICENSE | ||
| README.md | ||
commonmark-ext-heading-shifter
CommonMark extension for shifting heading levels by a configurable amount of levels.
Install
composer require tuchsoft/commonmark-ext-heading-shifter
Usage
use League\CommonMark\CommonMarkConverter;
use League\CommonMark\Environment;
use TuchSoft\CommonMarkHeadingShifter\HeadingShifterExtension;
$converter = new CommonMarkConverter([
'heading_shifter' => [
'shift_by' => 1
]
]);
$converter->getEnvironment()->addExtension(new HeadingShifterExtension());
$converter->convertToHtml("# Heading"); //<h2>Heading</h2>
Author
👤 Mattia Bonzi @ TuchSoft mattia@tuchsoft.com
- Website: tuchsoft.com
- Github: @tuchsoft
🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
