Skip to content

Commit

Permalink
Add ex_doc for hex publish of edoc (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
mworrell authored Jun 23, 2023
1 parent 2bda250 commit ac7b391
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ jobs:
run: make xref
- name: Dialyzer
run: make dialyzer
- name: EDoc
run: make edoc
6 changes: 4 additions & 2 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions rebar.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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">>}]}
].

0 comments on commit ac7b391

Please sign in to comment.