Skip to content
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

Use EDoc link for erlang type #1065

Closed
wants to merge 1 commit into from

Conversation

chulkilee
Copy link
Contributor

Fixes #1005

Copy link
Member

@wojtekmach wojtekmach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

FWIW, people can do:

defmodule :foo do
  @moduledoc "..."
end

and ExDoc will generate docs for it, so the heuristic that :module is documented using EDoc fails here. Personally I think it's an ok heuristic, but just mentioning this for completeness.

Fixes #1005

This PR only solves part of the problem, in order to close #1005 we'd need to make this work as well.

@moduledoc """
See `t::sets.set/0`.
"""

If you'd like to work on that aspect in a separate PR, that would be appreciated!

@chulkilee
Copy link
Contributor Author

@wojtekmach Oh, I didn't know that's possible (defmodule :foo). However, how can we know whether the referenced name is erlang or elixir? That seems impossible without this heuristic..

I'm not sure looking into alias is a good idea actually. Probably the language should be passed down to type_remote_url function - but I'm not sure that's even possible.

@josevalim
Copy link
Member

josevalim commented Jul 24, 2019 via email

@wojtekmach
Copy link
Member

However, how can we know whether the referenced name is erlang or elixir? That seems impossible without this heuristic..

As @josevalim wrote here

Would checking in deps for mix.exs or rebar.config be out of the question?

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.

so it's not a matter of whether it's Erlang or Elixir, but what tool was used to build the documentation for that particular module.

As José mentioned elsewhere, given different Erlang projects might use different tools, it's a safer bet to only use EDoc style urls for Erlang stdlib and leave others not linked.

@chulkilee
Copy link
Contributor Author

As José mentioned elsewhere, given different Erlang projects might use different tools, it's a safer bet to only use EDoc style urls for Erlang stdlib and leave others not linked.

@josevalim mentioned that at #1066 (comment)

I'm going to close this PR as it's not clear "adding more link to external erlang project" is the "right" direction to go at this moment.

@chulkilee chulkilee closed this Jul 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Can't link to remote types in Erlang projects
3 participants