PHP code example of scribe / pygments-bundle

1. Go to this page and download the library: Download scribe/pygments-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

scribe / pygments-bundle example snippets


# app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        //...
        new Kwattro\MarkdownBundle\KwattroMarkdownBundle(),
        new Varspool\PygmentsBundle\VarspoolPygmentsBundle(),
    );
}

$xhtml = $this->get('kwattro_markdown')->render($markdown_source);

$colorized_xhtml = $this->get('varspool_markdown')->render($markdown_source);

$pygments_formatter = $this->container->get('varspool_pygments');
$styles = $pygments_formatter->getStyles('friendly');
yaml
# app/config/routing.yml
varspool_pygments:
  resource: '@VarspoolPygmentsBundle/Controller/PygmentsController.php'
  type: annotation