On Wed, Oct 12, 2011 at 12:44 AM, Peter Nolan <[email protected]> wrote:
> Just wanted to stop by and say good work. Having recently made the full
> jump to ubuntu and erica this is welcomed news.
>
> Just a quick question though on vanilla local erica, how can i setup a
> template? I'm still really confused by the help options shown in the
> terminal.
>
> Thanks again,
>
> -Pete
>
Yes sorry, I shoudl give more love to the documentation. I will do
that asap. By setup you mean using our own template ? Anyway here is
some doc. I will put it on the erica wiki on github asap. Hope it
helps,
- benoît
To list templates installed:
$ erica list-templates
==> test (list-templates)
Available templates:
* couchapp: priv/templates/couchapp.template (escript)
* example: priv/templates/example.template (escript)
* simpleapp: priv/templates/simpleapp.template (escript)
To use a template:
$ erica create appid="yourappname" template="simpleapp" lang="javascript"
To create a blank app (== simpleapp) :
$ erica create-app appid=AppID lang=Lang
You can add your own templates in ~/.erica/templates . For example to
install the backbone-couchdb template [1] .simply link the
backbone-couchdb folder to ~/.erica/templates.
$ cd refuge
$ git clone https://github.com/janmonschke/backbone-couchdb.git
$ cd ~/.erica/templates/ && ln -s ~/refuge/backbone-couchdb .
$ erica list-templates
==> templates (list-templates)
Available templates:
* backbone:
/Users/benoitc/.erica/templates/backbone-couchdb/backbone.template
(file)
* couchapp: priv/templates/couchapp.template (escript)
* example: priv/templates/example.template (escript)
* simpleapp: priv/templates/simpleapp.template (escript)
backbone.template looks like:
$ more backbone-couchdb/backbone.template
{variables, [{appid, "myapp"}, {lang, "javascript"}]}.
{dir, "{{appid}}/_attachments"}.
{dir, "{{appid}}/views"}.
{dir, "{{appid}}/views/byCollection"}.
{template, "template/_id", "{{appid}}/_id"}.
{template, "template/language", "{{appid}}/language"}.
{file, "template/couchapp_rc", "{{appid}}/.couchapprc"}.
%% backbone
{file, "backbone-couchdb.js", "{{appid}}/_attachments/backbone-couchdb.js"}.
{file, "template/backbone.js", "{{appid}}/_attachments/backbone.js"}.
{file, "template/underscore.js", "{{appid}}/_attachments/underscore.js"}.
{template, "template/app.js", "{{appid}}/_attachments/app.js"}.
{file, "template/map.js", "{{appid}}/views/byCollection/map.js"}.
* file: used to copy a file
* dir: used t copy a dir
* template: used to pass environment variables
variables defaults can be set in variables and are passed on the command
line.
[1] https://github.com/janmonschke/backbone-couchdb