https://github.com/yanick/template-caribou
Because the world needs another templating system
https://github.com/yanick/template-caribou
Last synced: 4 months ago
JSON representation
Because the world needs another templating system
- Host: GitHub
- URL: https://github.com/yanick/template-caribou
- Owner: yanick
- License: other
- Created: 2011-12-04T19:53:11.000Z (over 13 years ago)
- Default Branch: releases
- Last Pushed: 2023-10-20T15:56:41.000Z (over 1 year ago)
- Last Synced: 2025-01-31T07:41:22.998Z (4 months ago)
- Language: Perl
- Homepage:
- Size: 208 KB
- Stars: 4
- Watchers: 2
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.mkdn
- Changelog: Changes
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# NAME
Template::Caribou - class-based HTML-centric templating system
# VERSION
version 1.2.2
# SYNOPSIS
```perl
package MyTemplate;use Template::Caribou;
use Template::Caribou::Tags::HTML qw/ :all /;
has name => ( is => 'ro' );
template page => sub {
my $self = shift;html {
head {
title { 'Example' }
};
$self->my_body;
}
};template my_body => sub {
my $self = shift;body {
h1 { 'howdie ' . $self->name }
}
};package main;
my $template = MyTemplate->new( name => 'Yanick' );
print $template->page;
```# DESCRIPTION
WARNING: Codebase is alpha with extreme prejudice. Assume that bugs are
teeming and that the API is subject to change.[Template::Caribou](https://metacpan.org/pod/Template%3A%3ACaribou) is a [Moose](https://metacpan.org/pod/Moose)-based, class-centric templating system
mostly aimed at producing sgml-like outputs, mostly HTML, but also XML, SVG, etc. It is
heavily inspired by [Template::Declare](https://metacpan.org/pod/Template%3A%3ADeclare).For a manual on how to use `Template::Caribou`, have a peek at
[Template::Caribou::Manual](https://metacpan.org/pod/Template%3A%3ACaribou%3A%3AManual).When `use`d within a namespace, `Template::Caribou` will apply the role [Template::Caribou::Role](https://metacpan.org/pod/Template%3A%3ACaribou%3A%3ARole)
to it (and auto-turn the namespace into Moose class if it wasn't a Moose class or role already),
as well as import the keywords `template` and `attr` (the latter from
[Template::Caribou::Tags](https://metacpan.org/pod/Template%3A%3ACaribou%3A%3ATags)), as well as load [Template::Caribou::Utils](https://metacpan.org/pod/Template%3A%3ACaribou%3A%3AUtils).# AUTHOR
Yanick Champoux [](http://coderwall.com/yanick)
# COPYRIGHT AND LICENSE
This software is copyright (c) 2023 by Yanick Champoux.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.