NAME

Bible::OBML::HTML - Render OBML as HTML

VERSION

version 1.12

SYNOPSIS

    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

DESCRIPTION

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.

METHODS

from_obml

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 );

from_file

This method accepts a string containing a filename (the file is assumed to contain valid OBML) and returns HTML.

    $self->from_file($filename);

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_file( $filename, 1 );

from_data

This method accepts a data structure that's a result of parsing OBML and returns HTML.

    $self->from_data($data);

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_data( $data, 1 );

ATTRIBUTES

obml

This module has an attribute of "obml" which contains a reference to an instance of Bible::OBML.

settings

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.

template

You can get or set the Template Toolkit template text with this accessor.

SEE ALSO

Bible::OBML, Bible::Reference.

You can also look for additional information at:

AUTHOR

Gryphon Shafer <gryphon@cpan.org>

COPYRIGHT AND LICENSE

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.