-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't link to remote types in Erlang projects #1005
Comments
Unfortunately we can only cross link to projects where the documentation
have been published with ExDoc. Maybe we can have a way to disable this for
projects of your choice if you know they don’t use ExDoc though but I am
afraid we can’t make it work.
--
*José Valim*
www.plataformatec.com.br
Skype: jv.ptec
Founder and Director of R&D
|
I might be good for a PR once I get Opencensus.Absinthe and Opencensus.Honeycomb settled. Simplest fix might be to suppress the type link from the function if the package atom starts with a lower case letter At least then we wouldn’t generate bad links. We’d also want to document the limitation. Would a warning on If we’re up for per-dependency type link resolution options: is there an obvious problem with defaulting to Would checking in |
I actually like this idea. the Mix integration already looks for dependencies in there. We can possibly see if the manager is :mix and not include the dependencies otherwise. |
We already have some support for cross linking to Erlang functions and types, e.g. this already works: @type t :: :file.posix and it builds the correct EDoc-style url. I'm not sure why linking to OTP works but to modules in dependencies doesn't, seem like a bug that should be relatively easy to fix. However, this indeed never worked:
but I think we could support this. To sum up, I think we could assume that "Erlang" modules are documented using EDoc and link to their types and callbacks. (We already link to functions.) |
Just hit this bug - as function link for Edoc works great, it would great if we can make type link work! erlang library functions: ex_doc/lib/ex_doc/formatter/html/autolink.ex Lines 381 to 389 in e91ceb6
erlang core type: ex_doc/lib/ex_doc/formatter/html/autolink.ex Line 280 in e91ceb6
|
I think we can solve it in #1132. When opencensus will start producing doc chunks we may assume it's docs are hosted on HexDocs.pm (maybe even using ExDoc, or we may need to make it configurable.) Until it's producing chunks we won't be auto linking to it. |
Start a new project:
Replace
mix.exs
with:Replace
lib/demo.ex
with:Build the documentation and open it:
mix do deps.get, deps.compile, docs open doc/Demo.html
Observe:
There doesn't appear to be a way to link from the
@doc
string to the remote type.The description of
hello
appears to correctly describe the types of the argument and return value:When you follow the link from
:opencensus.span()
, you get a broken link, not a working linkDouble-check with Dialyzer:
If you see this, you're going to have long enough to grab a coffee, eat dinner, or perhaps even cook dinner:
I've got something else to get to, so I'll click Submit and report back later with how it went. From what happened in my main project, however, I expect a complaint about the missing export in
opencensus
(census-instrumentation/opencensus-erlang#152) but not the reference to:opencensus.span()
.The text was updated successfully, but these errors were encountered: