ghislainphu/spress-codeblock

Add codeblock Twig function to Spress.

0.1.0 2016-05-25 18:15 UTC

This package is not auto-updated.

Last update: 2024-04-13 16:40:17 UTC


README

Spress 2 ready

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 &lt; and &gt; in markdown files

    This 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.