tuchsoft / commonmark-ext-heading-shifter
A CommonMark extension to adjust (decrease) heading levels by a custom amount.
Installs: 86
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Type:commonmark-extension
pkg:composer/tuchsoft/commonmark-ext-heading-shifter
Requires
- php: ^8.0
- league/commonmark: ^2.0
README
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.