odoc icon indicating copy to clipboard operation
odoc copied to clipboard

404 and canonical

Open panglesd opened this issue 11 months ago • 0 comments

As reported by @lukemaurer:

Getting a 404 out of a pretty simple issue with @canonical. The repro case is pleasingly small, if janky (compiled as library.ml):

(** @canonical Library.Submodule *)
module Submodule_ = struct
  module Export = struct end
end

module Submodule = Submodule_.Export

The odoc3 beta gives a page that says

module Submodule = Submodule.Export

(note that the double underscore is gone) but the link goes to /Library/Submodule_/Export/Export/index.html which is a 404 (extra Export). This also works with Submodule_ renamed to Submodule__ (in which case of course Export and Export/Export are both wrong). Obviously that @canonical is wrong, but there's not much of a way around it (it's generated by Dune). I imagine the best we can do is render it as a broken reference?

panglesd avatar Mar 04 '25 12:03 panglesd