2017 © Pedro PelĂĄez
 

library fshl

FSHL is a free, open source, universal, fast syntax highlighter written in PHP.

image

kukulich/fshl

FSHL is a free, open source, universal, fast syntax highlighter written in PHP.

  • Saturday, September 29, 2012
  • by kukulich
  • Repository
  • 8 Watchers
  • 70 Stars
  • 454,657 Installations
  • PHP
  • 12 Dependents
  • 0 Suggesters
  • 9 Forks
  • 8 Open issues
  • 3 Versions
  • 4 % Grown

The README.md

Welcome to FSHL

FSHL is a free, open source, universal, fast syntax highlighter written in PHP. A very fast parser performs syntax highlighting for few languages and produces a HTML output., (*1)

FSHL library is a simple, easy to use syntax highlighter. Its API provides only one method that is really need to highlight sources and three auxiliary methods to sets lexer and output mode., (*2)

FSHL core is very flexible and it is very easy to add new languages. Feel free to do so and do not forget to share them with the rest of the world., (*3)

Installation

FSHL should be installed using the PEAR Installer. This installer is the backbone of PEAR, which provides a distribution system for PHP packages, and is shipped with every release of PHP since version 4.3.0., (*4)

The PEAR channel that is used to distribute FSHL needs to be registered with the local PEAR environment., (*5)

    pear channel-discover pear.kukulich.cz

This has to be done only once. Now the PEAR Installer can be used to install packages from the kukulich channel:, (*6)

    pear install kukulich/FSHL

After the installation you can find the FSHL source files inside your local PEAR directory., (*7)

Example

    <?php
    $highlighter = new \FSHL\Highlighter(new \FSHL\Output\Html());
    $highlighter->setLexer(new \FSHL\Lexer\Php());
    echo '<pre>';
    echo $highlighter->highlight('<?php echo "Hello world!"; ?>');
    echo '</pre>';
    ?>

Or, (*8)

    <?php
    $highlighter = new \FSHL\Highlighter(new \FSHL\Output\Html(), \FSHL\Highlighter::OPTION_TAB_INDENT | \FSHL\Highlighter::OPTION_LINE_COUNTER);
    echo '<pre>';
    echo $highlighter->highlight('<?php echo "Hello world!"; ?>', new \FSHL\Lexer\Php());
    echo '</pre>';
    ?>

Stylesheet

A nice default stylesheet is located in the style.css file., (*9)

Requirements

FSHL requires PHP 5.3 or later., (*10)

Authors

The Versions

29/09 2012

dev-develop

dev-develop http://fshl.kukulich.cz/

FSHL is a free, open source, universal, fast syntax highlighter written in PHP.

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.3

 

library syntax highlight

08/09 2012

dev-master

9999999-dev http://fshl.kukulich.cz/

FSHL is a free, open source, universal, fast syntax highlighter written in PHP.

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.3

 

library syntax highlight

08/09 2012

2.1.0

2.1.0.0 http://fshl.kukulich.cz/

FSHL is a free, open source, universal, fast syntax highlighter written in PHP.

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.3

 

library syntax highlight