Skip to content

Commit

Permalink
include erlang docs in elixir docs (open-telemetry#20)
Browse files Browse the repository at this point in the history
* include erlang docs in elixir docs

* make erlang_docs function in mix.exs more readable

* make edocs before mix docs and add hex metadata
  • Loading branch information
tsloughter authored Feb 14, 2020
1 parent 18a7754 commit f1e69f1
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
edoc
.rebar3
_*
.eunit
Expand Down
32 changes: 29 additions & 3 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ defmodule OpenTelemetry.MixProject do
# source_url: "https://github.com/USER/PROJECT",
# homepage_url: "http://YOUR_PROJECT_HOMEPAGE",
docs: [
main: "OpenTelemetry"
markdown_processor: ExDoc.Markdown.Cmark,
main: "OpenTelemetry",
# logo: "path/to/logo.png",
# extras: ["README.md"]
]
extras: erlang_docs()
],
aliases: [
# when build docs first build edocs with rebar3
docs: ["cmd rebar3 edoc", "docs"]
],
package: package()
]
end

Expand All @@ -34,7 +40,27 @@ defmodule OpenTelemetry.MixProject do

def deps() do
[
{:cmark, "~> 0.7", only: :dev, runtime: false},
{:ex_doc, "~> 0.21", only: :dev, runtime: false}
]
end

defp package() do
[
description: "OpenTelemetry API",
build_tools: ["rebar3", "mix"],
licenses: ["Apache-2.0"],
links: %{"GitHub" => "https://github.com/open-telemetry/opentelemetry-erlang-api",
"OpenTelemetry.io" => "https://opentelemetry.io"}
]
end

def erlang_docs() do
files =
for file <- Path.wildcard("edoc/*.md"),
file != "edoc/README.md",
do: {file, [title: Path.basename(file, ".md")]}

[{"README.md", [title: "Overview"]} | files]
end
end
1 change: 1 addition & 0 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%{
"cmark": {:hex, :cmark, "0.7.0", "cf20106714b35801df3a2250a8ca478366f93ad6067df9d6815c80b2606ae01e", [:make, :mix], [], "hexpm", "deffa0b66cba126433efb54c068354bcf7c1fd8ba0f579741ab1d3cb26e0f942"},
"earmark": {:hex, :earmark, "1.4.2", "3aa0bd23bc4c61cf2f1e5d752d1bb470560a6f8539974f767a38923bb20e1d7f", [:mix], [], "hexpm", "5e8806285d8a3a8999bd38e4a73c58d28534c856bc38c44818e5ba85bbda16fb"},
"ex_doc": {:hex, :ex_doc, "0.21.2", "caca5bc28ed7b3bdc0b662f8afe2bee1eedb5c3cf7b322feeeb7c6ebbde089d6", [:mix], [{:earmark, "~> 1.3.3 or ~> 1.4", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "f1155337ae17ff7a1255217b4c1ceefcd1860b7ceb1a1874031e7a861b052e39"},
"makeup": {:hex, :makeup, "1.0.0", "671df94cf5a594b739ce03b0d0316aa64312cee2574b6a44becb83cd90fb05dc", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "a10c6eb62cca416019663129699769f0c2ccf39428b3bb3c0cb38c718a0c186d"},
Expand Down
8 changes: 7 additions & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
{deps, []}.

{profiles,
[{test, [{erl_opts, [nowarn_export_all]},
[{docs, [{deps, [edown]},
{edoc_opts,
[{doclet, edown_doclet},
{preprocess, true},
{dir, "edoc"},
{subpackages, true}]}]},
{test, [{erl_opts, [nowarn_export_all]},
{deps, [wts]},
{ct_opts, [{ct_hooks, [cth_surefire]}]}]}]}.

Expand Down
5 changes: 1 addition & 4 deletions src/opentelemetry_api.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@
stdlib
]},
{env,[]},
{modules, []},

{licenses, ["Apache 2.0"]},
{links, []}
{modules, []}
]}.

0 comments on commit f1e69f1

Please sign in to comment.