PHPackages                             ghislainphu/spress-codeblock - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. ghislainphu/spress-codeblock

ActiveSpress-plugin[Templating &amp; Views](/categories/templating)

ghislainphu/spress-codeblock
============================

Add codeblock Twig function to Spress.

0.1.0(10y ago)022MITPHP

Since May 25Pushed 10y ago1 watchersCompare

[ Source](https://github.com/GhislainPhu/spress-codeblock)[ Packagist](https://packagist.org/packages/ghislainphu/spress-codeblock)[ RSS](/packages/ghislainphu-spress-codeblock/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (2)Used By (0)

Spress Codeblock
================

[](#spress-codeblock)

[![Spress 2 ready](https://camo.githubusercontent.com/79b536fea9b26f54bab281b7abb70f6e7659a2f658f26ad23be1fd32af07be20/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f537072657373253230322d72656164792d627269676874677265656e2e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/79b536fea9b26f54bab281b7abb70f6e7659a2f658f26ad23be1fd32af07be20/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f537072657373253230322d72656164792d627269676874677265656e2e7376673f7374796c653d666c6174)

[Spress](https://github.com/spress/Spress) plugin to enable the Twig `codeblock` function from [ramsey/twig-codeblock](https://github.com/ramsey/twig-codeblock).

Getting Started
---------------

[](#getting-started)

Update your `composer.json` to use [GhislainPhu/Pygments.php](https://github.com/GhislainPhu/Pygments.php) instead of [kzykhys/Pygments.php](https://github.com/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
-----

[](#usage)

Please refer to upstream's [README.md](https://github.com/ramsey/twig-codeblock/blob/master/README.md) for more informations.

Known issues
------------

[](#known-issues)

- `` 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:

    ```

    {% codeblock lang:php %}
