An HTML preprocessor built for structure and style
npm install corgi-langhtml
`
via npm:
`bash
$ npm install --save corgi-lang
`
via yarn:
`bash
$ yarn add corgi-lang
`
Basic Usage
`corgi
// document.corgi
doctype html
htmllang="en"
meta[charset="UTF-8"]
meta[name="viewport",content="width=device-width,initial-scale=1"]
)
body(
h1("Corgi Example")
hr
p("This is an example HTML document written in "ahref="https://github.com/corgi-lang/corgi"".")
p("Follow Nektro on Twitter @Nektro")
)
)
`
`js
// web_app.js
fetch('document.corgi')
.then((response) => {
return response.text();
})
.then((text) => {
const html = corgi.compile(text);
})
`
`js
// node_app.js
const const = require('corgi-lang');
const fs = require('fs');
fs.readFile('document.corgi', 'utf8', function(err, data) {
const html = corgi.compile(data);
})
``