Closed
Description
Using filter_modules
in the mix.exs
doesn't produce warnings indicating undocumented code reference.
Using @moduledoc false
:
- Code:
defmodule Foo do
@moduledoc false
# "Private" module
@type foo :: integer()
end
defmodule Bar do
@moduledoc """
"Public" module
"""
alias Foo
@spec bar(Foo.foo()) :: nil
def bar(num) do
IO.inspect(num)
nil
end
end
- Generates warring while trying to generate docs to notify users, that they are using type reference unavailable in the documentation:
$ mix docs
Generating docs...
warning: documentation references type "Foo.foo()" but it is hidden or private
lib/membrane_template.ex:16: Bar.bar/1
View "html" docs at "doc/index.html"
Using filter_modules
:
mix.exs
defmodule Mixfile do
use Mix.Project
def project do
[
...
# docs
name: "Example",
source_url: @github_url,
docs: docs()
]
end
...
defp docs do
[
main: "readme",
extras: ["README.md", "LICENSE"],
formatters: ["html"],
source_ref: "v#{@version}",
filter_modules: ~r/Bar/,
]
end
end
- Code
defmodule Foo do
@moduledoc """
"Private" module excluded with `filter_modules`
"""
@type foo :: integer()
end
defmodule Bar do
@moduledoc """
"Public" module
"""
alias Foo
@spec bar(Foo.foo()) :: nil
def bar(num) do
IO.inspect(num)
nil
end
end
- Doesn't generate any warring, despite
Foo.foo()
being unavailable indocs
$ mix docs
Generating docs...
View "html" docs at "doc/index.html"
- Generated docs with
Foo.foo()
reference:

Metadata
Metadata
Assignees
Labels
No labels