defp docs do
[
extras: ["README.md", "CHANGELOG.md"],
main: "README"
]
end
When I generate the docs locally on my MacBook, and open doc/index.html, I see the README as I would expect.
However, after publishing the package to hex.pm and the docs to hexdocs.pm, I get a "PAGE NOT FOUND" error when accessing the online documentation. I can download the documentation as a tarball, and it works just fine locally on my MacBook. I can access any other page of the documentation, just not index.html or README.html.
The problem is case sensitivity. ex_doc turns README.md into readme.html, not README.html. When I open the docs locally on my MacBook, it works because MacOS is case insensitive---the link specifies README.html and the Apple file system happily provides readme.html. Since the rest of the world is case sensitive (including whatever drives hexdocs.pm) README.html doesn't exist.
mix.exs
has this configuration for the docs:When I generate the docs locally on my MacBook, and
open doc/index.html
, I see the README as I would expect.However, after publishing the package to hex.pm and the docs to hexdocs.pm, I get a "PAGE NOT FOUND" error when accessing the online documentation. I can download the documentation as a tarball, and it works just fine locally on my MacBook. I can access any other page of the documentation, just not
index.html
orREADME.html
.The problem is case sensitivity.
ex_doc
turnsREADME.md
intoreadme.html
, notREADME.html
. When I open the docs locally on my MacBook, it works because MacOS is case insensitive---the link specifiesREADME.html
and the Apple file system happily providesreadme.html
. Since the rest of the world is case sensitive (including whatever drives hexdocs.pm)README.html
doesn't exist.The solution is to set
main: "readme"
.