Skip to content

Commit

Permalink
Switch to attribute based documentation (#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
maennchen authored Aug 24, 2024
1 parent 034ad8c commit 78cda17
Show file tree
Hide file tree
Showing 19 changed files with 1,176 additions and 1,092 deletions.
8 changes: 8 additions & 0 deletions include/internal/doc.hrl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
%% TODO: Remove the following macros as soon as only OTP >= 27 is supported.
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
14 changes: 0 additions & 14 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ defmodule Oidcc.Mixfile do
docs: &docs/0,
description: to_string(@props[:description]),
package: package(),
aliases: [docs: ["compile", &edoc_chunks/1, "docs"]],
test_coverage: [ignore_modules: [Oidcc.RecordStruct]]
]
end
Expand Down Expand Up @@ -80,17 +79,4 @@ defmodule Oidcc.Mixfile do
assets: %{"assets" => "assets"}
]
end

defp edoc_chunks(_args) do
base_path = Path.dirname(__ENV__.file)
doc_chunk_path = Application.app_dir(:oidcc, "doc")

:ok =
:edoc.application(:oidcc, String.to_charlist(base_path),
doclet: :edoc_doclet_chunks,
layout: :edoc_layout_chunks,
preprocess: true,
dir: String.to_charlist(doc_chunk_path)
)
end
end
Loading

0 comments on commit 78cda17

Please sign in to comment.