Skip to content
This repository was archived by the owner on Nov 10, 2017. It is now read-only.

vkbansal/spectrum

Repository files navigation

Abandoned!

#Spectrum A syntax highlighter written in php. This project is inspired from prism.js by @LeaVerou.

##Installation

composer require vkbansal/spectrum

##Requirements

##Basic usage

<?php
use VKBansal\Spectrum\Spectrum;
$highlighter = new Spectrum();

###Highlighting HTML For highlighting HTML, code blocks must have a language- prefixed class attribute. For example, if you want to highlight HTML, the code block must have a language-html class.

Prism will auto-detect the language and apply highlighting if the language definition is found.

$html = <<<HTML
<html>
<head>
    <link rel="stylesheet" href="prism.css">
</head>
<body>
    <h1>Test</h1>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore laboriosam, magni facilis accusantium officia tenetur <code>voluptatum</code> voluptatem incidunt minus, corporis vel in sed veniam architecto? Doloremque nam excepturi pariatur, harum?</p>
    <pre><code class="language-html">
    <html>
        <head>
            <title>Title goes here!</title>
        </head>
        <br>
    </html>
    </code></pre>
</body>
</html>
HTML;

echo $highlighter->highlightHTML($html);

For more details go to website

About

Abandoned!

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors