webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Classes | Namespaces | Functions
hyperlight.php File Reference

Classes

class  NoMatchingRuleException
 
class  Rule
 
class  HyperLanguage
 
class  HyperlightCompiledLanguage
 
class  Hyperlight
 

Namespaces

 hyperlight
 

Functions

if(!function_exists('array_peek')) dump ($obj, $descr=null)
 
 hyperlight ($code, $lang, $tag='pre', array $attributes=array())
 
 hyperlight_file ($filename, $lang=null, $tag='pre', array $attributes=array())
 
if(defined('HYPERLIGHT_SHORTCUT')) hyperlight_calculate_fold_marks ($code, $lang)
 
 hyperlight_apply_fold_marks ($code, array $fold_marks)
 

Function Documentation

◆ dump()

if (!function_exists( 'array_peek')) dump (   $obj,
  $descr = null 
)

◆ hyperlight()

hyperlight (   $code,
  $lang,
  $tag = 'pre',
array  $attributes = array() 
)

echos a highlighted code.

For example, the following hyperlight('<?php echo \'Hello, world\'; ?>', 'php'); results in:

...

Parameters
string$codeThe code.
string$langThe language of the code.
string$tagThe surrounding tag to use. Optional.
array$attributesAttributes to decorate $tag with. If no tag is given, this argument can be passed in its place. This behaviour will be assumed if the third argument is an array. Attributes must be given as a hash of key value pairs.

◆ hyperlight_apply_fold_marks()

hyperlight_apply_fold_marks (   $code,
array  $fold_marks 
)

◆ hyperlight_calculate_fold_marks()

if (defined( 'HYPERLIGHT_SHORTCUT')) hyperlight_calculate_fold_marks (   $code,
  $lang 
)

◆ hyperlight_file()

hyperlight_file (   $filename,
  $lang = null,
  $tag = 'pre',
array  $attributes = array() 
)

Is the same as: hyperlight(file_get_contents($filename), $lang, $tag, $attributes);

See also
hyperlight()