Roberto Saccon 17 лет назад
Родитель
Сommit
44047fdfca
2 измененных файлов с 13 добавлено и 4 удалено
  1. 1 1
      src/demo/erlydtl_demo.erl
  2. 12 3
      src/erlydtl/erlydtl_api.erl

+ 1 - 1
src/demo/erlydtl_demo.erl

@@ -51,7 +51,7 @@ compile_templates() ->
         true,
         fun(Path, _Acc) ->
             Name = filename:rootname(filename:basename(Path)),
-            erlydtl_api:compile(Path, Name, "render", DocRoot)
+            erlydtl_api:compile(Path, Name, DocRoot)
         end,
         []).
   

+ 12 - 3
src/erlydtl/erlydtl_api.erl

@@ -34,16 +34,25 @@
 -author('rsaccon@gmail.com').
 
 %% API
--export([compile/4]).
+-export([compile/3, compile/4]).
 
+%%--------------------------------------------------------------------
+%% @spec (File:string(), ModuleName:string(), DocRoot:string()) -> 
+%%     {Ok::atom, Ast::tuple() | {Error::atom(), Msg:string()}
+%% @doc compiles a template to a beam file
+%% @end 
+%%--------------------------------------------------------------------
+compile(File, ModuleName, DocRoot) ->
+    compile(File, ModuleName, DocRoot, "render").
+    
 
 %%--------------------------------------------------------------------
-%% @spec (File:string(), ModuleName:string(), FunctionName:atom(), DocRoot:string()) -> 
+%% @spec (File:string(), ModuleName:string(), DocRoot:string(), FunctionName:atom()) -> 
 %%     {Ok::atom, Ast::tuple() | {Error::atom(), Msg:string()}
 %% @doc compiles a template to a beam file
 %% @end 
 %%--------------------------------------------------------------------
-compile(File, ModuleName, FunctionName, DocRoot) ->   
+compile(File, ModuleName, DocRoot, FunctionName) ->   
     case parse(File) of
         {ok, Ast} ->
 			RelDir = rel_dir(filename:dirname(File), DocRoot),