@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

    2

    Version

    0.0.2

    License

    ISC

    Last publish

    Collaborators

    • ianmcburnie