Closed ericmj closed 9 years ago
It looks like this is a problem with the autolinker, while it does check whether modules and functions exist in the current project it doesn't do so for types.
I spent a little bit of time looking at this and here's what I found. Suspect you guys already knew most of it, but I'm going to say it out loud for my understanding.
For the Version.Schema.t
example, Version.Schema
is a defrecord
inside Version
which does not have any documentation. ExDoc.Retriever.verify_module/2
removes these records from the list of modules to build documentation pages for. There is a comment calling out this fact in the code. Something about waiting for maps...
When ExDoc.HTMLFormatter.Autolink.typespec/3
runs, it calls ExDoc.HTMLFormatter.Autolink.get_source/2
which doesn't find Version.Schema
in the local aliases
list, but does find the beam file in the elixir lib path. At that point it constructs a link to where the doc page would be (had it not been stripped by the Retriever
). You need this elixir lib path check in general to catch other generic types (like String
).
Based on this, I don't see an easy way to catch this case. One option would be to allow doc pages to be created for these records. Or find some way to check __info__
and figure out it's not something we should be linking to.
Closing in favor of #192.
Here: http://elixir-lang.org/docs/master/Version.html we link to the types
Version.Schema.t
andVersion.Requirement.t
. The types are not documented which is creating 404 links.We should make sure we are not creating 404 links and we could warn that we are referencing a type that is not documented.