express-lml
v0.8.1
Published
Express view engine for LML - an HTML alternative
Downloads
2
Maintainers
Readme
express-lml
Express view engine for LML - an HTML alternative
Install
In your express.js project directory:
npm install express-lml --save-dev
Usage
use the exported loader and pass your express app instance:
loadViewEngine(app);
You can also pass options for parsing and output (to minify, order attributes etc):
loadViewEngine(app, {parse: parseConfig, output: outputConfig});
See LML README for available options.
Example
views/index.lml
:
!DOCTYPE html
html
head
title ; hello
body
h1 ; hello world!
app.js
:
const express = require('express');
const expressLML = require('express-lml');
const app = express();
const port = 3000;
expressLML.loadViewEngine(app);
// default folder for your LML files
app.set('views', './views');
app.get('/', function (req, res) {
res.render('index');
});
app.listen(port, () => console.log(`Example app listening on port ${port}!`));