Skip to content

Commit

Permalink
Merge pull request #21 from erszcz/use-new-edoc
Browse files Browse the repository at this point in the history
Prepare for OTP 24 EDoc
  • Loading branch information
uwiger committed May 17, 2021
2 parents 754be25 + 332b186 commit dd3d082
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
13 changes: 13 additions & 0 deletions src/edoc_compat.hrl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-ifndef(__EDOC_COMPAT_HRL__).
-define(__EDOC_COMPAT_HRL__, true).

-ifndef(NO_APP).
%% OTP 24+ EDoc
-define(NO_APP, no_app).
-define(context, doclet_context).
-else.
%% Pre OTP 24 EDoc
-define(context, context).
-endif. %% NO_APP

-endif. %% __EDOC_COMPAT_HRL__
7 changes: 4 additions & 3 deletions src/edown_doclet.erl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
-import(edoc_report, [report/2, warning/2]).

-include_lib("edoc/include/edoc_doclet.hrl").
-include("edoc_compat.hrl").

-define(EDOC_APP, edoc).
-define(DEFAULT_FILE_SUFFIX, ".md").
Expand Down Expand Up @@ -109,9 +110,9 @@ run(#doclet_toc{}=Cmd, Ctxt) ->
toc(Cmd#doclet_toc.paths, Ctxt).

gen(Sources, App, Modules, Ctxt) ->
Dir = Ctxt#context.dir,
Env = Ctxt#context.env,
Options0 = Ctxt#context.opts,
Dir = Ctxt#?context.dir,
Env = Ctxt#?context.env,
Options0 = Ctxt#?context.opts,
Options = set_app_default([{layout,edown_layout} |
Options0] ++
[{file_suffix,".md"}]),
Expand Down

0 comments on commit dd3d082

Please sign in to comment.