diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 69863a6..4dcce75 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,3 +29,5 @@ jobs: run: make xref - name: Dialyzer run: make dialyzer + - name: EDoc + run: make edoc diff --git a/GNUmakefile b/GNUmakefile index b2a55c9..81a188c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -19,7 +19,7 @@ $(REBAR): chmod +x $(REBAR) # Use Rebar to get, update and compile dependencies -.PHONY: upgrade-deps compile compile shell dialyzer xref test +.PHONY: upgrade-deps compile compile shell dialyzer xref test edoc upgrade-deps: $(REBAR) $(REBAR) $(REBAR_OPTS) upgrade @@ -37,8 +37,10 @@ xref: $(REBAR) $(REBAR) xref test: $(REBAR) - $(REBAR) $(REBAR_OPTS) ct + $(REBAR) $(REBAR_OPTS) ct +edoc: $(REBAR) + $(REBAR) ex_doc # Cleaning .PHONY: clean_logs diff --git a/README.md b/README.md index f015c11..15d09c1 100644 --- a/README.md +++ b/README.md @@ -130,17 +130,17 @@ Context = your_request_context, % Context passed to the runtime module and f {ok, IOList} = template_compiler:render("hello.tpl", Vars, Options, Context). ``` -The `render/4` function looks up the template, ensures it is compiled, and then calls the compiled render -function of the template or the templates it extends (which are also compiled etc.). +The `template_compiler:render/4` function looks up the template, ensures it is compiled, and then +calls the compiled render function of the template or the templates it extends (which are also compiled etc.). -Use `compile_file/3` and `compile_binary/4` to compile a template file or in-memory binary to a module: +Use `template_compiler:compile_file/3` and `template_compiler:compile_binary/4` to compile a template file or in-memory binary to a module: ```erlang {ok, Module} = template_compiler:compile_binary(<<"...">>, Filename, Options, Context). ``` -The `Filename` is used to reference the compiled binary. +The Filename is used to reference the compiled binary. #### Force recompilation diff --git a/rebar.config b/rebar.config index fa6548e..135b9cb 100644 --- a/rebar.config +++ b/rebar.config @@ -9,6 +9,16 @@ {zotonic_stdlib, "~> 1.6"} ]}. +{project_plugins, [rebar3_ex_doc]}. + +{hex, [{doc, ex_doc}]}. + +{ex_doc, [ + {source_url, <<"https://github.com/zotonic/z_stdlib">>}, + {extras, [<<"README.md">>, <<"LICENSE">>]}, + {main, <<"readme">>} +]}. + {xref_checks, [ undefined_function_calls, locals_not_used, diff --git a/rebar.lock b/rebar.lock index 91b9d1a..f5f7dbb 100644 --- a/rebar.lock +++ b/rebar.lock @@ -3,20 +3,20 @@ {<<"qdate_localtime">>,{pkg,<<"qdate_localtime">>,<<"1.2.0">>},0}, {<<"ssl_verify_fun">>,{pkg,<<"ssl_verify_fun">>,<<"1.1.6">>},2}, {<<"tls_certificate_check">>, - {pkg,<<"tls_certificate_check">>,<<"1.16.0">>}, + {pkg,<<"tls_certificate_check">>,<<"1.18.1">>}, 1}, - {<<"zotonic_stdlib">>,{pkg,<<"zotonic_stdlib">>,<<"1.11.2">>},0}]}. + {<<"zotonic_stdlib">>,{pkg,<<"zotonic_stdlib">>,<<"1.15.0">>},0}]}. [ {pkg_hash,[ {<<"cowlib">>, <<"0B9FF9C346629256C42EBE1EEB769A83C6CB771A6EE5960BD110AB0B9B872063">>}, {<<"qdate_localtime">>, <<"644ADE4C7F7EAC765E2048DFA714D78EA86BAF5255FE46279B2EAC5729760A07">>}, {<<"ssl_verify_fun">>, <<"CF344F5692C82D2CD7554F5EC8FD961548D4FD09E7D22F5B62482E5AEAEBD4B0">>}, - {<<"tls_certificate_check">>, <<"45B05E3B993DBACE2E4EBCCB666EADBD038F1DA8F4DB9691F4F34A274DFB0BD7">>}, - {<<"zotonic_stdlib">>, <<"CAC0BA50B041C38DD7925B990DAC084616CCA1E042FE82E458A94E52A89F3E26">>}]}, + {<<"tls_certificate_check">>, <<"54033CCBA6D5C7DC249C9D88243CCF9BAC2285784B9B7E258404B4B5AFF3DF10">>}, + {<<"zotonic_stdlib">>, <<"0876BB82B9CFDE331DC758C8A7818181BB5654F137723DF137DE53C25AD3DD1D">>}]}, {pkg_hash_ext,[ {<<"cowlib">>, <<"2B3E9DA0B21C4565751A6D4901C20D1B4CC25CBB7FD50D91D2AB6DD287BC86A9">>}, {<<"qdate_localtime">>, <<"98A538A5B6046B8652DFC5630B030D0414A1B31D0130C81FA6B88B5C1E625109">>}, {<<"ssl_verify_fun">>, <<"BDB0D2471F453C88FF3908E7686F86F9BE327D065CC1EC16FA4540197EA04680">>}, - {<<"tls_certificate_check">>, <<"3DC0508C749619B8D6A5E21ACA4D719C184F065541795B0556398C8E574A3064">>}, - {<<"zotonic_stdlib">>, <<"AEBF9DD330207A9FB73FC1744EE4037BAC4B62A21EB13D6DA5BD951A5D658C89">>}]} + {<<"tls_certificate_check">>, <<"078DE55B522D0550FE8112C01D33B380CFA55E8EC662DDA300457CC67895A9B6">>}, + {<<"zotonic_stdlib">>, <<"1864A96F2B5AE278DC52607F89CC90BF492713E7C3AC8EADDC1BA863E06E5921">>}]} ].