Skip to content

Commit

Permalink
Remove now unused handle_file function
Browse files Browse the repository at this point in the history
This function was used by sherlodoc, it is not anymore.
  • Loading branch information
panglesd committed Dec 9, 2024
1 parent 15ff72c commit 6d3c2a6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
17 changes: 0 additions & 17 deletions src/odoc/indexing.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down
9 changes: 0 additions & 9 deletions src/odoc/indexing.mli
Original file line number Diff line number Diff line change
@@ -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 ->
Expand Down

0 comments on commit 6d3c2a6

Please sign in to comment.