obadakhalili / sprightly Goto Github PK
View Code? Open in Web Editor NEW๐ก A very light-weight JS template engine
๐ก A very light-weight JS template engine
Read this to understand express's template engine invocation logic.
The package should provide a .__express
API that maps to invoking the sprightly engine with the default parameters. Also, there should be another API for users to pass options for the engine.
The first API is invoked directly by express and the user doesn't have to know about it. The second one the user sets it up using the syntax:
app.engine("html", <call to a function that returns the sprightly engine function loaded with the passed options>);
Write the documentation in the README.md file.
New engine's requirements are described in #2
i newly to this template look fun but seems need docs to render dynamic pages,
Make sure that the rewrite achieves the following:
.replaceAll()
to implement the transformation logic../views
and the dir is laid out as follows:./views
+- file.spy
+- subfolder
+---- nested-file.spy
If subfolder/nested-file.spy
wanted to include file.spy
as a partial, it would have to reference it as follows ./file.spy
instead of ../file.spy
(since it's one level up in the tree) because the files are resolved relative to the pre-set ./views
directory. You need to fix this behavior and implement the correct one mentioned first.
function sprightly(
entryPoint: string,
data: Record<string, string>,
options: { cache: boolean }
): Promise<string> {
...
}
<h1>{{ nested.property }}</h1>
and
const data = {
nested: {
property: "Osid's awesome"
}
}
should resolve in:
<h1>Osid's awesome</h1>
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.