NAME

A1z::HTML5::Template - Fast/easy HTML5 apps/pages in Perl

VERSION

version 0.09

SYNOPSIS

    use A1z::HTML5::Template;
    my $foo = A1z::HTML5::Template->new();

    use lib '/home/user/path/to/app';

	# for features like 'say'
	use 5.10.0;

	my $h = A1z::HTML5::Template->new(); 

	say $h->header('utf8');  
	say $h->start_html(); 
	say $h->head_title("My New App"); 
	say $h->head_meta(); 
	say $h->head_js_css(); 
	say $h->head_js_css('/url/to/app/Template.css'); 
	say $h->end_head(); 
	say $h->begin_body();

	say qq{<h1>My New App/Website</h1>};

	say qq{<main class="container">}; 

	# output file content as menu
	say $h->body_accordion( $h->open_file("/home/user/path/to/app/open_file_example.txt", 'menu', 'Menu') ); 

	# as a HTML5 table 
	say $h->body_accordion( $h->open_file("$sys{cgibase}/open_file_example.txt", 'table', 'Table Header') );
		
	# math works 
	say $h->body_article( header => "Simple Mathematics", content => $h->math1("2", "4") );

	# math works 
	say $h->body_article( header => "Times Table", content => $h->timestable("2") );

	# Both body_accordion and body_article are used synonymously and do the same thing but with little variations.

	say qq{</main>};

	say $h->body_js_css(); 
	say $h->end_body();
	say $h->end_html(); 

NAME

A1z::HTML5::Template is a perl implementation of customizable HTML5 tags.

Installation

cpan install A1z::HTML5::Template 
or
cpanm A1z::HTML5::Template

VERSION

Version 0.09

METHODS

header start_html head_title head_meta head_js_css end_head begin_body body_js_css body_topnavbar body_accordion end_body end_html 

new

use A1z::HTML5::Template;
my $h = A1z::HTML5::Template->new();

math1

$h->math1(num1, num2);

$h->body_article( header => "Math", content => $h->math1(num1, num2) );

timestable

$h->timestable("Number");
Provides HTML Content-Header 

$h->header("");

start_html

Provides doctype html

$h->start_html();

$h->start_html('utf8');

body_js_css

Add/include javascript and css files just above </body> section 

Typically, CSS files should/are not be used here. 

Default behavior: 

	$h->body_js_css();
	
	Includes 
		jquery 1.12.4, jquery ui 1.11.4, bootstrap 3.3.0, 
		javascript for #dialog function, #menu, #accordion, #tabs 

Add your own .js file: 
	
	use $h->body_js_css("/path/to/js/file.js");
	
You can use both to include default .js files and your own custom .js file. 

end_html

Provides </html>

head_title

Provides <title></title>

$h->head_title("App/Page Title");

head_meta

Provides <meta ... >. Includes the following by default:
	IE=Edge
	HandheldFriendly
	viewport

$h->head_meta();

Just like body_js_css, you can use both to add default values and your own meta 

body_topnavbar

Provides top nav bar optionally.

By default it is loaded from secure.bislinks.com which probably be removed in a future version.
So, get a copy from bootstrap 3 and store it on your server.

head_js_css

provides the ability to add/include .js/.css files in the </head> tag.

$h->head_js_css();

	Default includes the following:
	
		bootstrap 3.3.0 .css from maxcdn 
		navbar-fixed-top.css from secure.bislinks.com
		jquery 1.12.1 smoothness theme from code.jquery.com 
		Shim and Respond.js from maxcdn 

$h->head_js_css("/path/to/.js")
$h->head_js_css("/path/to/.css")

end_head

Provides </head>

$h->end_head();

begin_body

provides <body> tag.

$h->begin_body();

body_accordion

say $h->body_accordion( $h->open_file("C:/Users/user/public/app/open_file_example.txt", 'Type', 'Header') ); 

body_article

provides the ability to add content into <main> tags. 

$h->body_article( header => "", content => "");

end_body

provides </body> tag.

$h->end_body();

body_form

provides the ability to add forms 

$h->body_form();

defaults_begin

Provides defaults for very lightweight template for those in a hurry; Can be used for apps/sites that are under construction! 

$h->defaults_begin();

defaults_end

provides defaults for lightweight or under construction app/website. 

$h->defaults_end();

HTML Hash

Default HTML used in default_*

html_bootstrap_css

AUTHOR

Sudheer Murthy, <pause at a1z.us>

BUGS

Please report any bugs or feature requests to bug-html5-template at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=HTML5-Template. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc A1z::HTML5::Template

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2018 Sudheer Murthy.

This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:

http://www.perlfoundation.org/artistic_license_2_0

Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.

If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.

This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.

This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed.

Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

AUTHOR

Sudheer Murthy <pause@a1z.us>

COPYRIGHT AND LICENSE

This software is copyright (c) 2018 by Sudheer Murthy.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.