diff --git a/src/document/url.ml b/src/document/url.ml index 0e4bfb01ac..4c3f3847c9 100644 --- a/src/document/url.ml +++ b/src/document/url.ml @@ -115,7 +115,7 @@ module Path = struct let pp_kind fmt kind = Format.fprintf fmt "%s" (string_of_kind kind) - let pp_kind_prefix_for_output fmt = function + let pp_disambiguating_prefix fmt = function | `Module | `Page | `LeafPage | `File | `SourcePage -> () | kind -> Format.fprintf fmt "%s-" (string_of_kind kind) diff --git a/src/document/url.mli b/src/document/url.mli index 2b13e4de8e..4dabe5365f 100644 --- a/src/document/url.mli +++ b/src/document/url.mli @@ -27,8 +27,9 @@ module Path : sig val string_of_kind : kind -> string - val pp_kind_prefix_for_output : Format.formatter -> kind -> unit - (** Print the ["kind-"] prefix used in output files. *) + val pp_disambiguating_prefix : Format.formatter -> kind -> unit + (** Print the ["kind-"] prefix used to disambiguate urls in "flat modes": + e.g. latex labels and output files in [--flat] HTML and man output *) type t = { kind : kind; parent : t option; name : string } diff --git a/src/html/generator.ml b/src/html/generator.ml index 58c5e34b27..0240afd3c9 100644 --- a/src/html/generator.ml +++ b/src/html/generator.ml @@ -476,7 +476,7 @@ end module Page = struct let on_sub = function - | `Page _ -> None + | `Pge _ -> None | `Include x -> ( match x.Include.status with | `Closed | `Open | `Default -> None diff --git a/src/html/link.ml b/src/html/link.ml index dba7b7d3d9..f0724694e3 100644 --- a/src/html/link.ml +++ b/src/html/link.ml @@ -5,7 +5,7 @@ module Path = struct let for_printing url = List.map snd @@ Url.Path.to_list url let segment_to_string (kind, name) = - Format.asprintf "%a%s" Url.Path.pp_kind_prefix_for_output kind name + Format.asprintf "%a%s" Url.Path.pp_disambiguating_prefix kind name let is_leaf_page url = url.Url.Path.kind = `LeafPage diff --git a/src/latex/generator.ml b/src/latex/generator.ml index 0ba76c2f8f..5cd04bb52f 100644 --- a/src/latex/generator.ml +++ b/src/latex/generator.ml @@ -10,7 +10,7 @@ module Link = struct | None -> () in Format.fprintf ppf "%a%a%s" pp_parent x.parent - Url.Path.pp_kind_prefix_for_output x.kind x.name + Url.Path.pp_disambiguating_prefix x.kind x.name let page p = Format.asprintf "%a" flatten_path p diff --git a/src/manpage/link.ml b/src/manpage/link.ml index 3fd606b29e..2e577028ec 100644 --- a/src/manpage/link.ml +++ b/src/manpage/link.ml @@ -3,7 +3,7 @@ open Odoc_document let for_printing url = List.map snd @@ Url.Path.to_list url let segment_to_string (kind, name) = - Format.asprintf "%a%s" Url.Path.pp_kind_prefix_for_output kind name + Format.asprintf "%a%s" Url.Path.pp_disambiguating_prefix kind name let as_filename ?(add_ext = true) (url : Url.Path.t) = let components = Url.Path.to_list url in