exodist / dsl-html Goto Github PK
View Code? Open in Web Editor NEWDeclarative DSL(domain specific language) for writing HTML templates within perl.
Declarative DSL(domain specific language) for writing HTML templates within perl.
In your example, you use tag span { 'copyright ©' }
, however the ampersand is escaped, so it looks like a literal ©
when rendered in the browser.
Can be reproduced with the following code:
#!/usr/bin/perl
package blah;
use strict;
use warnings;
use DSL::HTML;
template my_template {
tag span { 'copyright ©' }
}
print build_template(my_template => '');
On my (under development) system, I prefer to build a template as fragment which only include the tags I specified, and to push it myself into the container document. I believe this case is legitimate and useful, but it does not seem possible without breaking the encapsulation of DSL::HTML::Rendering.
perhaps, instead of compile, there should be 2 methods : compile() (no container) and compile_document() (with container).
The following code does what I need (if the template has 1 root tag), but is really ugly :
my $r = DSL::HTML::Rendering->new($tpl);
$r->build(@_);
return $r->body->content->[0]->as_HTML(undef, $r->template->indent);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.