How to generate documentation for specific modules using rebar3?

I am unable to generate documentation only for specific modules using rebar3 and when publishing the library, the documentation will be generated for all modules automatically.

Now running this command locally I get the desired results: erl -noshell -run edoc_run files '["src/mymodule.erl"]' '[{dir, "doc"}]'

But running rebar3 edoc results documenation for all modules.
Inside rebar.config I have:

{edoc_opts, [
    {preprocess, true},
    {files, ["src/mymodule.erl"]},
    {overview, "doc/overview.edoc"},
    {modules, [mymodule]},
    {dir, "doc"}]}.

I have 2 questions:

  1. How can I generate documentation for specific modules only using rebar3 edoc command.
  2. Does rebar3 hex publish execute rebar3 edoc behind the scenes?

Adding %% @private in the module top level comment removed the module from the documentation list.


Maybe is the @hidden tag you were looking for?

Marks the module so that it will not appear in the documentation (even if “private” documentation is generated). Useful for sample code, test modules, etc. The content can be used as a comment; it is ignored by EDoc.

See the modules section in the EDoc documentation.


Thanks for the response. @hidden also would work in my case.