Skip to content

Commit 2a193d2

Browse files
authored
mix style documentation (#6)
* Hex doc Documentation generation based on hex.pm publishing documentation recomendaton. Provide using rebar3_ex_doc functionality. We have an option to generate mix style documetation of a Erlang library. To do so just run `rebar3 ex_doc --logo doc/img/logo.png --output edoc` command and check a result. * Tune rebar.config * Update README.md Add information related to documentation generation. * Update .gitignore Add logo image. * Update .gitignore Add logo image. * Update .gitignore Add ignoring edoc folder * Tune GNUmakefile Add an option to generate Exdoc to make file. Tune README.md.
1 parent ab52449 commit 2a193d2

File tree

8 files changed

+49
-6
lines changed

8 files changed

+49
-6
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ rel/example_project
1111
.rebar3
1212
_build/
1313
rebar3
14+
edoc
1415
doc/*
1516
!doc/style.css
1617
!doc/overview.edoc
18+
!doc/img
19+
!doc/img/*
20+
!doc/img/logo.png

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### v1.1.0
2+
3+
- Move to GH Actions. by @mworrell in [#3](https://github.com/zotonic/dispatch_compiler/pull/3)
4+
- Property-based tests by @rustkas in [#5](https://github.com/zotonic/dispatch_compiler/pull/5)
5+
- Documentation improvements by @rustkas in [#4](https://github.com/zotonic/dispatch_compiler/pull/4)

GNUmakefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ xref: $(REBAR)
3636

3737
test: $(REBAR)
3838
$(REBAR) $(REBAR_OPTS) ct
39-
$(REBAR) proper -n 1
39+
$(REBAR) as test proper -n 1
4040

4141

4242
# Cleaning
@@ -64,4 +64,7 @@ docs: $(REBAR)
6464
$(REBAR) edoc
6565

6666
edoc_private: $(REBAR)
67-
$(REBAR) as edoc_private edoc
67+
$(REBAR) as edoc_private edoc
68+
69+
exdoc: $(REBAR)
70+
$(REBAR) ex_doc --logo doc/img/logo.png --output edoc

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
![Test](https://github.com/zotonic/dispatch_compiler/workflows/Test/badge.svg)
2+
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg?logo=apache&logoColor=red)](https://www.apache.org/licenses/LICENSE-2.0)
23

34
# dispatch_compiler
45

@@ -70,3 +71,15 @@ If no dispatch rule could be matched, then `fail` is returned:
7071

7172
Run `make test` to run the tests.
7273

74+
## Documentation generation
75+
76+
### Edoc
77+
78+
#### Generate public API
79+
`rebar3 edoc`
80+
81+
#### Generate private API
82+
`rebar3 as edoc_private edoc`
83+
84+
### ExDoc
85+
`rebar3 ex_doc --logo doc/img/logo.png --output edoc`

doc/img/logo.png

9.61 KB
Loading

doc/overview.edoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
@title dispatch_compiler
33
@doc Compiles dispatch rules to an Erlang module for quick matching.
44
@copyright Apache 2.0
5-

doc/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ table[summary="navigation bar"] {
6868

6969
code, p>tt, a>tt {
7070
font-size: 1.2em;
71-
}
71+
}

rebar.config

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,28 @@
3838
no_return
3939
]}
4040
]},
41-
41+
{plugins, [
42+
rebar3_proper
43+
]},
4244
{deps, [{proper,"1.4.0"}]}
4345
]}
4446
]}.
4547

46-
{project_plugins, [rebar3_proper]}.
48+
{project_plugins, [rebar3_hex, rebar3_ex_doc]}.
49+
50+
{hex, [
51+
{doc, #{provider => ex_doc}}
52+
]}.
53+
54+
{ex_doc, [
55+
{extras, [
56+
{"README.md", #{title => "Overview"}},
57+
{"CHANGELOG.md", #{title => "Changelog"}},
58+
{"LICENSE", #{title => "License"}}
59+
]},
60+
{main, "README.md"},
61+
{source_url, "https://github.com/zotonic/dispatch_compiler"},
62+
{assets, "assets"},
63+
{api_reference, true}
64+
]}.
65+

0 commit comments

Comments
 (0)