NAME
Asterisk::config::syntax - highlight Asterisk config syntax
SYNOPSIS
use strict;
use Asterisk::config::syntax;
my $config = Asterisk::config::syntax->new();
$config->load_file(file=>file name);
print @{$config->return_html_array_ref()};
DESCRIPTION
This module highlighting Asterisk config syntax into HTML .It's simple to used.
CONSTRUCTOR
new
my $config = Asterisk::config::syntax->new();
Constructs and returns a brand new Asterisk::config::syntax object ready to be exploited.
METHODS
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.
COLORING YOUR HIGHLIGHTED CSS
To actually set any colors on your "highlighted" CSS code returned from the dump2html()
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:
css-code
- this is actually the class name that will be set on the<pre>>
element if you have that option turned on.keyword
- Asterisk's keywordsfunction
- Asterisk's functioncomment
- Commentvalue
- Valuesidentifier
- Identifierexten
- like keyword
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
Syntax::Highlight::Engine::Simple
AUTHOR
XuHao, <loveme1314 at gamil.com>
COPYRIGHT & LICENSE
Copyright (C) 2009, http://blog.sakuras.cn. All Rights Reserved.
This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 516:
=back without =over