Skip to content

Commit

Permalink
Docs housekeeping
Browse files Browse the repository at this point in the history
List of changes:
- fix docs generation error in `rebar3 ex_doc` and `rebar3 hex publish`
- fix incorrect CI badge
- set min OTP version in rebar config
- update copyright year
- update development instruction in readme
- add links and revise function comments
  • Loading branch information
kianmeng committed Jun 27, 2024
1 parent 1b4fe3c commit 0df5ba5
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 28 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015-2023, Benoit Chesneau <[email protected]>.
Copyright (c) 2015-2024, Benoit Chesneau <[email protected]>.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# [certifi](https://github.com/certifi/erlang-certifi)

[![Build Status](https://github.com/certifi/erlang-certifi/workflows/build/badge.svg)](https://github.com/certifi/erlang-certifi)
[![CI](https://github.com/certifi/erlang-certifi/actions/workflows/erlang.yml/badge.svg)](https://github.com/certifi/erlang-certifi/actions/workflows/erlang.yml)
[![Hex](https://img.shields.io/hexpm/v/certifi.svg)](https://hex.pm/packages/certifi)
[![HexDocs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/certifi)

This Erlang library contains a CA bundle that you can reference in your Erlang
application. This is useful for systems that do not have CA bundles that
Expand Down Expand Up @@ -29,22 +31,16 @@ You can also retrieve the path to the file and load it by yourself if needed:
Path = certifi:cacertfile().
```

## Build & test
## Development

Testing:

```shell
$ rebar3 eunit
rebar3 eunit
```

## Documentation generation

### Edoc

#### Generate public API
`rebar3 edoc`

#### Generate private API
`rebar3 as edoc_private edoc`
Documentation:

### ExDoc

`rebar3 ex_doc --output edoc`
```shell
rebar3 ex_doc
```
14 changes: 9 additions & 5 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{minimum_otp_vsn, "21.3"}.

{erl_first_files, ["src/certifi_pt.erl"]}.

{erl_opts, [deterministic %% Added since OTP 20
,{platform_define, "^2", 'OTP_20_AND_ABOVE'}
]}.
{profiles, [
%% Since OTP 20
{default, [{erl_opts, [deterministic, {platform_define, "^2", 'OTP_20_AND_ABOVE'}]}]},
{docs, [{erl_opts, []}]}
]}.

{project_plugins, [rebar3_hex, rebar3_ex_doc]}.

Expand All @@ -12,8 +16,8 @@

{ex_doc, [
{extras, [
{"README.md", #{title => "Overview"}},
{"LICENSE", #{title => "License"}}
{"README.md", #{title => "Overview"}},
{"LICENSE", #{title => "License"}}
]},
{main, "README.md"},
{source_url, "https://github.com/certifi/erlang-certifi"},
Expand Down
17 changes: 10 additions & 7 deletions src/certifi.erl
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
-module(certifi).
%% Causes the parse transformation function Module:parse_transform/2
%% Causes the parse transformation function Module:parse_transform/2
%% to be applied to the parsed code before the code is checked for errors.
-compile({parse_transform, certifi_pt}).

-export([cacertfile/0,
cacerts/0]).

%% @doc CACertFile gives the path to the file with an X.509 certificate list
%% containing the Mozilla CA Certificate that can then be used via the
%% cacertfile setting in ssl options passed to the connect function.

%% containing the Mozilla CA Certificate.
%%
%% The file is used via the `cacertfile' setting in {@link //ssl/ssl} options,
%% passed to the `ssl:connect/2,3,4' function.
-spec cacertfile() -> Result when
Result :: file:filename_all().
cacertfile() ->
Expand All @@ -25,8 +26,10 @@ cacertfile() ->
filename:join(PrivDir, "cacerts.pem").

%% @doc CACerts builds an X.509 certificate list containing the Mozilla CA
%% Certificate that can then be used via the cacerts setting in ssl options
%% passed to the connect function.
%% Certificate.
%%
%% The certificate list is used via the `cacerts' setting in {@link //ssl/ssl}
%% options, passed to the `connect/2,3,4' function.
-spec cacerts() -> [binary(),...].
cacerts() ->
ok.
ok.

0 comments on commit 0df5ba5

Please sign in to comment.