Skip to content
This repository has been archived by the owner on May 23, 2021. It is now read-only.

sparksp/laravel-syntaxhighlighter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SyntaxHighlighter Bundle

A SyntaxHighlighter bundle for Laravel.

Installation

Install and publish via the Artian CLI:

php artisan bundle:install syntaxhighlighter
php artisan bundle:publish syntaxhighlighter

Or download the zip and unpack into your bundles directory, and copy the public files in to public/bundles/syntaxhighlighter.

## Bundle Registration

You need to register SyntaxHighlighter with your application before you can use it. Simply edit application/bundles.php and add the following to the array:

'topos' => array(
    'autoloads' => array(
        'map' => array(
            'Topos\\Menu' => '(:bundle)/menu.php',
        ),
    ),
),

Alternatively you can add just 'syntaxhighlighter' and use Bundle::start('syntaxhighlighter') each time before you want to use it.

Guide

Start the bundle and highlight some code:

echo SyntaxHighlighter::highlight($code, 'html');

You'll also need to output the scripts from the 'footer' asset container somewhere (like the end of your layout):

echo Asset::container('footer')->scripts();

## Configure

You can change the default style and language in the config/default.php. If you add any new brushes you can configure them in config/brush.php.