Skip to content

TuchSoft/commonmark-ext-heading-shifter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

commonmark-ext-heading-shifter

License: MIT Copyright: Tuchsoft

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

TuchSoft logo

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page.

About

CommonMark extension for shifting heading levels

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages