Skip to content

demarche1/simple-template-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a super simple template engine, just for the purpose of understanding how the template engine works.

How to use

// in js file

import View from './core/View.js'

const v = new View()

v.render('profile.html', {
  name: 'Jhon',
  age: 30,
  address {
    street: "Jhon`s Street",
    number: 987
  },
  skills: ['html', 'css', 'js']
})
<!-- in views/profile.html -->

<h1> My name is: <& this.name &> </h1>
<h2> I Have <& this.age &> yo </h2>
<p> My address is: <& this.addres.street &>, <& this.addres.number &> <p/>

<& for (var index in this.skills) { &>
  <p> My skills is: <& this.skills[index] &> </p>
<& } &>

About

an simple template engine made with JavaScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published