diff --git a/src/odoc/indexing.ml b/src/odoc/indexing.ml index 7ac04222a1..65fb95fc48 100644 --- a/src/odoc/indexing.ml +++ b/src/odoc/indexing.ml @@ -7,23 +7,6 @@ open Odoc_model module H = Odoc_model.Paths.Identifier.Hashtbl.Any module Id = Odoc_model.Paths.Identifier -let handle_file file ~unit ~page ~occ = - match Fpath.basename file with - | s when String.is_prefix ~affix:"index-" s -> - Odoc_file.load_index file >>= fun index -> Ok (occ index) - | _ -> ( - Odoc_file.load file >>= fun unit' -> - match unit' with - | { Odoc_file.content = Unit_content unit'; _ } when unit'.hidden -> - Error (`Msg "Hidden units are ignored when generating an index") - | { Odoc_file.content = Unit_content unit'; _ } -> Ok (unit unit') - | { Odoc_file.content = Page_content page'; _ } -> Ok (page page') - | _ -> - Error - (`Msg - "Only pages and unit are allowed as input when generating an \ - index")) - let parse_input_file input = let is_sep = function '\n' | '\r' -> true | _ -> false in Fs.File.read input >>= fun content -> diff --git a/src/odoc/indexing.mli b/src/odoc/indexing.mli index ebe59dabc3..342e5e03d3 100644 --- a/src/odoc/indexing.mli +++ b/src/odoc/indexing.mli @@ -1,14 +1,5 @@ open Or_error -val handle_file : - Fpath.t -> - unit:(Odoc_model.Lang.Compilation_unit.t -> 'a) -> - page:(Odoc_model.Lang.Page.t -> 'a) -> - occ:(Odoc_index.Skeleton.t list -> 'a) -> - ('a, [> msg ]) result -(** This function is exposed for custom indexers that uses [odoc] as a library - to generate their search index *) - val compile : [ `JSON | `Marshall ] -> output:Fs.file ->