I found, that erlydtl may be used with nitrogen.
Unfortunately, author hasn't described how he installed erlydtl to make it usable from nitrogen.
Probably somebody has ever faced with the same issue, I'm facing with. If so, please share your experience.
Thank you in advance.
You should be able to just add ErlyDTL to your app's rebar.config:
Then run
./rebar get-deps compileto install it in lib/ directory of your app and recompile.Here's the step-by-step instructions
Create a new folder to hold Nitrogen repo:
$ mkdir nitrogen-dtl$ cd nitrodgen-dtlClone Nitrogen from GitHub:
git clone https://github.com/nitrogen/nitrogen.gitcd nitrogenBuild a slim (1) or a full (2) release called "dtltest" locateed in nitrogen-dtl folder:
make slim_inets PROJECT=dtltest(1)make rel_inets PROJECT=dtltest(2)Edit rebar.config in dtltest folder:
cd ../dtltestvi rebar.configadd the ErlyDTL as a dependency (and a comma to the line before it):
Download and compile dependencies with rebar:
./rebar get-deps compileStart Nitrogen console, verify that application is running and try compiling an ErlyDTL template:
([email protected])1> erlydtl:compile_template("<html>{{ greeting }}</html>", dtltest_template).([email protected])2> dtltest_template:render([{greeting, "Hallo Welt!"}]).You should get a rendered template:
If the template compiles, then ErlyDTL is installed correctly and you can use the code similar to the Gist you referenced in your application.
Cheers!