Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating docs with ExDoc instead of EDoc #308

Merged
merged 3 commits into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{config,src}]
[*.{config, src}]
indent_style = space

[*.{md,markdown}]
[*.md]
indent_style = space
trim_trailing_whitespace = false

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
matrix:
os: [ubuntu-latest]
otp: ["24", "23", "22"]
rebar3: ["3.17.0"]
rebar3: ["3.18.0"]
profile: [test, ranch_v2]
include:
- os: ubuntu-latest
Expand Down Expand Up @@ -51,6 +51,9 @@ jobs:
- name: Xref
run: make xref

- name: Format
run: rebar3 fmt --check

- name: Test
run: make test REBAR_PROFILE=${{ matrix.profile }}

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Doc
name: Docs

on:
push:
Expand All @@ -11,14 +11,14 @@ on:
jobs:

docs:
name: Build EDoc on OTP ${{ matrix.otp }}
name: Generate docs on OTP ${{ matrix.otp }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
otp: ["24"]
rebar3: ["3.17.0"]
otp: ["24"] # https://www.erlang.org/downloads
rebar3: ["3.18.0"] # https://www.rebar3.org

steps:
- uses: actions/checkout@v2
Expand All @@ -35,5 +35,5 @@ jobs:
key: ${{ runner.os }}-hex-${{ hashFiles('**/rebar.lock') }}
restore-keys: ${{ runner.os }}-hex-

- name: Build EDoc
run: make docs
- name: Generate docs by ExDoc
run: rebar3 ex_doc
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The run command could have stayed the same, now as I also changed the Makefile.

7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ clean:
@rebar3 clean -a

test:
ERL_AFLAGS="-s ssl"
ERL_AFLAGS="-s ssl"
rebar3 as $(REBAR_PROFILE) eunit -c

proper:
Expand All @@ -23,7 +23,10 @@ dialyze:
xref:
rebar3 as test xref

format:
rebar3 fmt

docs:
rebar3 edoc
rebar3 ex_doc

.PHONY: compile clean test dialyze
4 changes: 2 additions & 2 deletions README.markdown → README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# gen_smtp

[![Hex pm](http://img.shields.io/hexpm/v/gen_smtp.svg?style=flat)](https://hex.pm/packages/gen_smtp)
[![CI](https://github.com/gen-smtp/gen_smtp/workflows/CI/badge.svg)](https://github.com/gen-smtp/gen_smtp/actions?query=workflow%3ACI)
[![Documentation](https://github.com/gen-smtp/gen_smtp/workflows/Documentation/badge.svg)](https://github.com/gen-smtp/gen_smtp/actions?query=workflow%3ADocumentation)
[![CI](https://github.com/gen-smtp/gen_smtp/actions/workflows/ci.yml/badge.svg)](https://github.com/gen-smtp/gen_smtp/actions/workflows/ci.yml)
[![Docs](https://github.com/gen-smtp/gen_smtp/actions/workflows/docs.yml/badge.svg)](https://github.com/gen-smtp/gen_smtp/actions/workflows/docs.yml)

The Erlang SMTP client and server library.

Expand Down
11 changes: 11 additions & 0 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@

{project_plugins, [
erlfmt,
rebar3_ex_doc,
rebar3_proper
]}.

{erlfmt, [
write,
{print_width, 120},
Expand Down Expand Up @@ -73,3 +75,12 @@
]}
]}
]}.

{ex_doc, [
{source_url, <<"https://github.com/gen-smtp/gen_smtp">>},
{extras, [
{'README.md', [{title, <<"Overview">>}]},
{'LICENSE', [{title, <<"License">>}]}
]},
{main, <<"readme">>}
]}.
2 changes: 1 addition & 1 deletion src/gen_smtp.app.src
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{application, gen_smtp, [
{description, "The extensible Erlang SMTP client and server library."},
{vsn, "1.1.1"},
{vsn, "1.2.0-dev"},
{applications, [kernel, stdlib, crypto, asn1, public_key, ssl, ranch]},
{registered, []},
{licenses, ["BSD-2-Clause"]},
Expand Down
10 changes: 0 additions & 10 deletions src/gen_smtp_server_session.erl
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,7 @@
options = [] :: [tuple()]
}).

%% OTP-19: ssl:ssl_option()
%% OTP-20: ssl:ssl_option()
%% OTP-21: ssl:tls_server_option()
%% OTP-22: ssl:tls_server_option()
%% OTP-23: ssl:tls_server_option()
-ifdef(OTP_RELEASE).
-type tls_opt() :: ssl:tls_server_option().
-else.
-type tls_opt() :: ssl:ssl_option().
-endif.

-type options() :: [
{callbackoptions, any()}
Expand Down Expand Up @@ -179,7 +170,6 @@
-optional_callbacks([handle_info/2, handle_AUTH/4, handle_error/3]).

%% @doc Start a SMTP session linked to the calling process.
%% @see start/3
-spec start_link(
Ref :: ranch:ref(),
Transport :: module(),
Expand Down