emmett-framework / renoir Goto Github PK
View Code? Open in Web Editor NEWA templating engine designed with simplicity in mind
License: BSD 3-Clause "New" or "Revised" License
A templating engine designed with simplicity in mind
License: BSD 3-Clause "New" or "Revised" License
I'm getting to know the project, it looks interesting. I checked one of the examples from the documentation and it didn't work as I expected. the word "Index" was not included in the title. Something is wrong or I don't understand the idea.
https://github.com/emmett-framework/renoir/blob/master/docs/quickstart.md
Template inheritance
output:
<html lang="en">
<head>
<link rel="stylesheet" href="style.css" />
<title> - My Webpage</title>
<style type="text/css">
.title { color: #336699; }
</style>
</head>
<body>
<div id="content">
Index
<h1>Index</h1>
<p class="title">
Welcome to my awesome homepage.
</p>
</div>
<div id="footer">
Copyright 2020 by you.
</div>
</body>
</html>
Hi
what is the Renoir syntax to output an unescaped HTML string created by a function in a template?
If I have {{=f()}} in the template then I get an escaped string e.g.
<div class="some-class" ...
obviously I want
I want to use a string that contains html and use it unescaped in my template.
I thought I could use asis inside renoir for it but it does not work:
Template:
<title>My Webpage</title> {{ =asis(message) }}error:
File "/Users/kkeller/Development/websaw_upytl/websaw/example.html", line 6, in template
{{ =asis(message) }}
NameError: name 'asis' is not defined
Could you help me?
Thanks!
If an include block is used inside a try / except or if / then / else logic it breaks renoir.
Please refer to this discussion for regarding the use case:
Example template code:
<div class="columns">
[[try:]]
[[if level == 'manager':]]
[[include 'manager_menu.html']]
<div class="column is-10">
<div class="box">
[[include]]
</div>
</div>
[[elif level == "admin":]]
[[include 'admin_menu.html']]
<div class="column is-10">
<div class="box">
[[include]]
</div>
</div>
[[else:]]
<div class="column is-12">
[[include]]
</div>
[[pass]]
[[except:]]
<div class="column is-12">
[[include]]
</div>
[[pass]]
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.