Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prior to this change, "dune ocaml doc" would attempt to open an incorrect url in browsers: "file://_build/default/_doc/_html/index.html". This is incorrect because it appears to be a path relative to the project root, but browsers interpret "file://foo/some/path" as the path "/some/path" on the host referred to by "foo". In my experiments however, the "foo" component is ignored and the browser redirects to "file:///some/path" instead. Indeed, when I run "dune ocaml doc" I end up at "file:///default/_doc/_html/index.html", with the "_build" component of the path being ignored, and the remainder of the path treated as an absolute path (which obviously doesn't refer to the correct file). It seems like droppping the "file://" prefix of the url is enough to get browers to accept the relative path and correctly navigate to "file:///absolute/path/to/index.html". Alternatively we could fix the logic for computing an absolute path to index.html and keep the "file://" prefix of the url, but that seems more complicated. I've updated a variable name from "absolute_toplevel_index_pathh" to "relative_toplevel_index_path" to reflect that it is in fact a path relative to the project root and not an absolute path. Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
- Loading branch information