keeto / slab Goto Github PK
View Code? Open in Web Editor NEWSlab is a templating engine for JavaScript.
License: MIT License
Slab is a templating engine for JavaScript.
License: MIT License
There's a linebreak issue I've experienced in Express.js when rendering one slab file.
I have yet to test in browser.
If my layout slab is:
{slab layout}
<!doctype html>
<html>
<head>
<title></title>
</head>
<body>
{body}
</body>
</html>
{endslab}
The output is:
<!doctype html>
<html>
<head>
<title></title>
</head>
<body>
{body}
</body>
</html>
I'm not sure what the issue is, but its fixed with:
{slab layout}<!doctype html>
<html>
<head>
<title></title>
</head>
<body>
{body}
</body>
</html>{endslab}
I'm getting a recursive error when doing multiple includes without loops.
"Uncaught SlabError: Recursive includes for template "li" (li > otherLi > li)."
var str = '{slab ul}\
<ul>\
{include li}\
{include otherLi}\
</ul>\
{endslab}\
\
{slab li}\
<li></li>\
{endslab}\
\
{slab otherLi}\
{include li}\
{endslab}';
var template = slab.compile(str);
console.log(template.ul({}));
I'm getting "Uncaught SlabError: Can't compile slab template. Unexpected identifier in the browser with the following code.
var str = '{slab test} \
{keep} \
{slab something} \
<script>var obj = {\'stuff\':\'things\'};</script> \
{endslab} \
{endkeep} \
{endslab}';
var template = Slab.compile(str);
console.log(template.test({}));
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.