corgi-lang
v1.0.4
Published
An HTML preprocessor built for structure and style
Downloads
4
Readme
Corgi
Corgi - the HTML Preprocessor built for style and structure, brought to you by mantle.js.
Installation
on the web:
<script src="path/to/mantle.js"></script>
<script src="path/to/corgi.js"></script>
via npm:
$ npm install --save corgi-lang
via yarn:
$ yarn add corgi-lang
Basic Usage
// document.corgi
doctype html
html[lang="en"](
head(
title("Corgi Example")
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 "a[href="https://github.com/corgi-lang/corgi"]("Corgi")".")
p("Follow Nektro on Twitter @Nektro")
)
)
// web_app.js
fetch('document.corgi')
.then((response) => {
return response.text();
})
.then((text) => {
const html = corgi.compile(text);
})
// 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);
})
Full Documentation
https://corgi-lang.github.io/corgi/
Credits
- Made with mantle.js - https://github.com/Nektro/mantle.js
- Inspired by Pug - https://github.com/pugjs/pug
Contributors
| Name | Github | Twitter | Website | | --- | --- | --- | --- | | Sean D | @Nektro | @Nektro | dev.nektro.net
License
Apache 2, see LICENSE