npm

Bring the best of OSS JavaScript development to your projects with npm Orgs - private packages & team management tools.Learn more »

@ianmcburnie/marko-to-html

0.0.2 • Public • Published

marko-to-html

Renders marko template to html file.

template.marko

<h1>Hello ${data.name}!</h1>
<ul if="notEmpty(data.colors)">
    <li class="color" for="color in data.colors">
        ${color}
    </li>
</ul>
<div else>
    No colors!
</div>

data.json

{
    "name": "Frank",
    "colors": ["red", "green", "blue"]
}
 

From module

var markoToHtml = require('@ianmcburnie/marko-to-html');
 
markoToHtml('template.marko', 'data.json');

From command line

node index.js 'template.marko' 'data.json'

template.html

<h1>Hello Frank!</h1>
<ul>
    <li class="color">red</li>
    <li class="color">green</li>
    <li class="color">blue</li>
</ul>

Keywords

none

install

npm i @ianmcburnie/marko-to-html

Downloadsweekly downloads

0

version

0.0.2

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability