https://github.com/night-codes/pigeon-js
Pigeon is an HTML preprocessor / template engine written in Javascript.
https://github.com/night-codes/pigeon-js
Last synced: over 1 year ago
JSON representation
Pigeon is an HTML preprocessor / template engine written in Javascript.
- Host: GitHub
- URL: https://github.com/night-codes/pigeon-js
- Owner: night-codes
- License: mit
- Created: 2015-11-03T04:49:48.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-02T22:48:51.000Z (over 10 years ago)
- Last Synced: 2025-01-23T23:32:51.466Z (over 1 year ago)
- Language: JavaScript
- Homepage: http://avxto.github.io/pigeon-js
- Size: 293 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.TXT
Awesome Lists containing this project
README
# Pigeon
[](https://travis-ci.org/avxto/pigeon-js)
[](https://david-dm.org/avxto/pigeon-js)
Pigeon is an HTML preprocessor / template engine written in Javascript.
# Installation
```npm install pigeon-js```
# About
Pigeon is an HTML preprocessor. However, you do not need to learn a new language — you can stick to Javascript. Pigeon is an alternative to Absurd's HTML preprocessor.
# Usage
``` javascript
var pigeon = require('pigeon-js');
var data = {
content: 'Content'
};
var convert = {
_: 'html',
html: {
head: {
style: '.example {display: block;}',
title: 'My title',
script: 'function helloWorld () { console.log("Hello World"); }',
},
body: {
'.main#ID': {
'.child.child': 'Content',
'.anotherchild': 'Content',
'.lastchild': data.content
},
},
}
};
pigeon(convert, function(err, html) {
console.log(html);
});
```
### Displays
``` html
.example {
display: block;
}
My title
function helloWorld() {
console.log("Hello World");
}
Content
Content
Content
```
# Todo
- [ ] Support for YAML (Cleaner syntax, no quotation marks and braces)
- [x] Support same properties
- [ ] Support for attributes other than classes and id's.
# License
The MIT License is a free software license originating at the Massachusetts Institute of Technology (MIT). It is a permissive free software license, meaning that it permits reuse within proprietary software provided all copies of the licensed software include a copy of the MIT License terms and the copyright notice.