SakuraScript::HTML - SakuraScript HTML Formatter
naruto/CANO-Lab <mikiso@gf6.so-net.ne.jp>
$color = new SakuraScript::HTML(style => 'font', parser => $parser);
$color->set(scope0 => 'white', scope1 => 'yellow', tag => 'lime');
print $color->color('\t\0Hello\1\w9Hello\e');
Converts SakuraScript to neatly formatted HTML style. Tags and metawords are differently colored.
``>'' and ``<'' characters are escaped.
new(%params)Constructor of SakuraScript::HTML object. Initialization is done by passing a hash. Available options are as follows:
font, with which your script is marked like <font color="black">.
Set this to style in order to mark your script like <span style="color: black">,
class like <span class="foo">.
font or style, set these options to color values (e.g. #FFFFFF,
red).
If html_tag is style, you can also set these options
like ``color: red; text-decoration: underline''
If html_tag option is class, there options are used to determine the element classes.
No matter the value of html_tag is, you can set these options to ``none'', meaning no
html tag is placed to that element.
\h and \u tags to change script scope.
\0 and \1 tags to change script scope.
set(%params)Sets coloring options after initialization. Available options are the same as new(%params).
parser($parser)Sets SakuraScript::Parser object. The same as
$color->set(parser => $parser);
color($script)Converts SakuraScript to HTML.
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.