Skip to content

GhislainPhu/spress-codeblock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Spress Codeblock

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.

About

Add codeblock Twig function to Spress.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages