CityBaseInc / airbrake_client

Airbrake client to report errors and exceptions to Airbrake.io.
Other
0 stars 1 forks source link

Fix README.html problem on hexdocs.pm #8

Closed jdfrens closed 3 years ago

jdfrens commented 3 years ago

mix.exs has this configuration for the docs:

  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.

The solution is to set main: "readme".