Bible::OBML::HTML - Render OBML as HTML
version 1.14
use Bible::OBML::HTML; my $self = Bible::OBML::HTML->new; $self->from_obml($obml); $self->from_file($filename); $self->from_data($data); $self->from_obml( $obml, $skip_smartify ); $self->from_file( $filename, $skip_smartify ); $self->from_data( $data, $skip_smartify ); $self->settings; # get or set Template Toolkit new() hashref $self->template; # get or set Template Toolkit template text
This module renders a reasonably reusable HTML block from OBML in either text, file, or data sources. "Reasonably reusable" means that it is a block of HTML without header or "HTML" tag and contains HTML5-valid HTML, mostly in the form of DIV tags and other symantically expected nested HTML.
The intent here is that if you have OBML and need to view it in some nicer form, like on a web site, you can use this module's methods to generate a core block of HTML, which you'd then wrap with whatever HTML wrapper and CSS you'd like.
This method accepts a string (assumed to contain valid OBML) and returns HTML.
$self->from_obml($obml);
A second optional boolean can be provided, and if true, will cause the method to skip running the "smartify" method on the content.
$self->from_obml( $obml, 1 );
This method accepts a string containing a filename (the file is assumed to contain valid OBML) and returns HTML.
$self->from_file($filename);
$self->from_file( $filename, 1 );
This method accepts a data structure that's a result of parsing OBML and returns HTML.
$self->from_data($data);
$self->from_data( $data, 1 );
This module has an attribute of "obml" which contains a reference to an instance of Bible::OBML.
Internally, this module uses Template::Toolkit to render HTML from OBML. The module ships with Toolkit settings and a template. You can replace the "settings" hashref that's passed to Toolkit's new()) with this settings() accessor.
new()
settings()
You can get or set the Template Toolkit template text with this accessor.
Bible::OBML, Bible::Reference.
You can also look for additional information at:
GitHub
MetaCPAN
Travis CI
Coveralls
CPANTS
CPAN Testers
Gryphon Shafer <gryphon@cpan.org>
This software is copyright (c) 2020 by Gryphon Shafer.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Bible::OBML, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bible::OBML
CPAN shell
perl -MCPAN -e shell install Bible::OBML
For more information on module installation, please visit the detailed CPAN module installation guide.