https://github.com/abailly/yate
Yet Another Template Engine
https://github.com/abailly/yate
Last synced: over 1 year ago
JSON representation
Yet Another Template Engine
- Host: GitHub
- URL: https://github.com/abailly/yate
- Owner: abailly
- License: other
- Created: 2014-03-10T10:58:57.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2020-03-28T15:23:05.000Z (about 6 years ago)
- Last Synced: 2025-01-06T21:45:40.701Z (over 1 year ago)
- Language: Haskell
- Size: 27.3 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
**This project is in its infancy and the infant mortality of dev projects is very high. Use at your own risks...**
# Yet Another Template Engine
A Simple template engine initially created to speed-up generation of new projects in various languages, first of all Haskell.
# Rationale
It has become commonplace in various languages to provide *bootstrappers*, usually in the form of command-line utilities, that
create new instances of a project in a the target language given some basic project description, usually sorting out dependencies.
In the java world, one can use
[maven archetypes](https://maven.apache.org/guides/introduction/introduction-to-archetypes.html), in clojure we use
[lein new](https://github.com/technomancy/leiningen), in javascript there is [bower](https://github.com/bower/bower), in scala
[conscript](https://github.com/n8han/conscript/)...
There is nothing similar in Haskell and each and every time I start a new development I have to copy/paste existing project to get
a walking skeleton. So I started working on a small template-based generator that would allow me to maintain various projects
skeletons and instantiate them at will.
# Usage
```
yate [template id] [output directory] [template descriptor]
```
## Template Id
One of:
* A directory inside the directory referenced by `YATE_TEMPLATES` environment variable, defaulting to current directory,
* A github-hosted project under the current user id,
* A full github URI to a project.
## Template Descriptor
A Haskell data-structure providing objects to instantiate variables, for example:
```
"project" :>: L [
"name" :>: S "myproj",
"version" :>: S "1.0",
"synopsis" :>: S "This is a sample project",
"authors" :>: L [
"author" :>: L [
"name":>: S "Arnaud Bailly ",
"year" :>: S "2014"]]]
```
# Templates
* Use [mustache](http:://mustache.github.io) syntax,
* May contain a `.mapping` file that is itself a template defining how to map source files to target files.
# TODO
* Use [hastache](https://github.com/lymar/hastache)
* Use pure JSON as project descriptor