Asterisk::config::syntax::highlight - highlight Asterisk config syntax


Asterisk-config-syntax-highlight documentation  | view source Contained in the Asterisk-config-syntax-highlight distribution.

Index


NAME

Top

Asterisk::config::syntax::highlight - highlight Asterisk config syntax

SYNOPSIS

Top

    use strict;
    use Asterisk::config::syntax::highlight;

    my $config = Asterisk::config::syntax::highlight->new();
       $config->load_file(file=>file name);
    print join '<br />', @{$config->return_html_array_ref()};
    print join "\n", @{$config->return_ubb_array_ref()};
    print join "\n", @{$config->return_wiki_array_ref()};
    exit;

DESCRIPTION

Top

This module highlighting Asterisk config syntax into HTML .It's simple to used.

CONSTRUCTOR

Top

new

    my $config = Asterisk::config::syntax::highlight->new();




Constructs and returns a brand new Asterisk::config::syntax::highlight object ready to be exploited.

METHODS

Top

load_file

    load_file(file=>file name);

Takes one mandatory argument which is a asterisk config file that you want to highlight.

return_html_array_ref

    return_html_array_ref;

Returns the highlighted code as HTML by array references.

return_ubb_array_ref

    return_ubb_array_ref;

Returns the highlighted code as UBB by array references.

return_wiki_array_ref

    return_wiki_array_ref;

Returns the highlighted code as WIKITEXT by array references.

COLORING YOUR HIGHLIGHTED CSS

Top

To actually set any colors on your "highlighted" CSS code returned from the return_html_array_ref() method you need to style all the generated <spans> with CSS; a sample CSS code to do that is shown in the section below. Each <span> will have the following class names/meanings:

SAMPLE STYLE SHEET FOR COLORING HIGHLIGHTED CODE

 span.keyword  {color: #00f}

 span.function {color: #808}

 span.comment   {color: #080}

 span.value     {color: #f80}

 span.identifier {color: #a66}

 span.exten     {color: red}

SEE ALSO

Top

Syntax::Highlight::Engine::Simple

AUTHOR

Top

XuHao, <loveme1314 at gamil.com>

COPYRIGHT & LICENSE

Top


Asterisk-config-syntax-highlight documentation  | view source Contained in the Asterisk-config-syntax-highlight distribution.