NAME

SakuraScript::HTML - SakuraScript HTML Formatter


AUTHOR

naruto/CANO-Lab <mikiso@gf6.so-net.ne.jp>


SYNOPSIS

  $color = new SakuraScript::HTML(style => 'font', parser => $parser);
  $color->set(scope0 => 'white', scope1 => 'yellow', tag => 'lime');
  print $color->color('\t\0Hello\1\w9Hello\e');


DESCRIPTION

Converts SakuraScript to neatly formatted HTML style. Tags and metawords are differently colored.

``>'' and ``<'' characters are escaped.


METHODS

new(%params)

Constructor of SakuraScript::HTML object. Initialization is done by passing a hash. Available options are as follows:

html_tag
Defines how your SakuraScript elements are tagged. Default value is 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">.

scope0, scope1, synchro, tag, meta, err
These options are set to define the color (or style) of each SakuraScript element. When html_tag option is 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.

use_hu
Whether to recognize \h and \u tags to change script scope.

use_01
Whether to recognize \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.


SEE ALSO


LICENSE

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.