Skip to content
Browse files

organize into standard erlang package layout and add makefile

  • Loading branch information...
1 parent 795a15f commit 112cf172847f489d5dd5d44dfb8a13d08dc66610 @mojombo committed
Showing with 30 additions and 3 deletions.
  1. +6 −0 Emakefile
  2. +12 −0 Makefile
  3. +12 −3 README.md
  4. 0 ebin/.gitignore
  5. 0 { → src}/mustache.erl
View
6 Emakefile
@@ -0,0 +1,6 @@
+% -*- mode: erlang -*-
+{["src/*"],
+ [{i, "include"},
+ {outdir, "ebin"},
+ debug_info]
+}.
View
12 Makefile
@@ -0,0 +1,12 @@
+ERL ?= erl
+EBIN_DIRS := $(wildcard deps/*/ebin)
+
+all: erl
+
+erl:
+ @$(ERL) -pa $(EBIN_DIRS) -noinput +B \
+ -eval 'case make:all() of up_to_date -> halt(0); error -> halt(1) end.'
+
+clean:
+ @echo "removing:"
+ @rm -fv ebin/*.beam
View
15 README.md
@@ -24,11 +24,22 @@ of Mustache for Ruby and the performance (even with compiled templates) is not
yet where I'd like it to be.
+Installation
+------------
+
+To compile the code, navigate to the Mustache.erl project root and issue:
+
+ make
+
+This will produce a `mustache.beam` file in the `ebin` directory that must be
+included in the code path of projects that need it.
+
+
The Simplest Example
--------------------
The simplest example involves using a string template and a context from the
-REPL. Make sure `mustache.beam` is in your code path.
+REPL.
1> Ctx = dict:from_list([{planet, "World!"}]).
{dict,1,16,16,8,80,48,...}
@@ -213,8 +224,6 @@ TODO
----
* Support partials
-* Organize into traditional Erlang package structure
-* Get a Makefile going
* Learn some things from erlydtl (speed improvments, perhaps)
View
0 ebin/.gitignore
No changes.
View
0 mustache.erl → src/mustache.erl
File renamed without changes.

0 comments on commit 112cf17

Please sign in to comment.
Something went wrong with that request. Please try again.