ghislainphu / spress-codeblock
Add codeblock Twig function to Spress.
Installs: 22
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:spress-plugin
Requires
- ramsey/twig-codeblock: ^1.0
- spress/spress-installer: 2.0.*
This package is not auto-updated.
Last update: 2025-02-01 20:58:26 UTC
README
Spress plugin to enable the Twig codeblock
function from ramsey/twig-codeblock.
Getting Started
Update your composer.json
to use GhislainPhu/Pygments.php instead of kzykhys/Pygments.php:
{ "repositories": [ { "type": "vcs", "url": "https://github.com/GhislainPhu/Pygments.php" } ], "require": { "kzykhys/pygments": "dev-symfony-process-3 as 1.0-dev" } }
Run:
composer require ghislainphu/spress-codeblock
Usage
Please refer to upstream's README.md for more informations.
Known issues
-
<
and>
are converted to<
and>
in markdown filesThis issue exists because the markdown converter runs before Twig.
Solution: Wrap your code inside of a
div
tag:<div> {% codeblock lang:php %} <?php echo 'Hello World!'; {% endcodeblock %} </div>
License
This project is licensed under the MIT License.
See LICENSE.md for more informations.