Skip to content

Commit

Permalink
Compatibilty with odoc 89175b19aeae7e181fd46ce6f74b643367713cfb
Browse files Browse the repository at this point in the history
  • Loading branch information
EmileTrotignon committed Oct 16, 2023
1 parent a58f0d6 commit d665c8b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions bin/JSherlodoc/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ let search message =
in
Jv.(apply (get global "postMessage"))
[| Jv.of_list
(fun Db.Elt.{ json_output; _ } ->
json_output |> Jstr.of_string |> Brr.Json.decode |> Result.get_ok)
(fun Db.Elt.{ json_display; _ } ->
json_display |> Jstr.of_string |> Brr.Json.decode |> Result.get_ok)
results
|]

Expand Down
2 changes: 1 addition & 1 deletion lib/db/elt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module T = struct
; kind : kind
; has_doc: bool
; pkg : package option
; json_output : string
; json_display : string
}

let compare_pkg { name; version = _ } (b : package) =
Expand Down
4 changes: 2 additions & 2 deletions lib/index_lib/load_doc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ module Make (Storage : Db.Storage.S) = struct
| Doc _ -> Pretty.prefixname id
| _ -> full_name
in
let json_output = Json_output.string_of_entry entry in
let json_display = entry |> Json_display.of_entry |> Odoc_html.Json.to_string in
let has_doc = doc.txt <> "" in
let elt = Elt.{ name; kind = kind'; pkg = None ; json_output ; has_doc} in
let elt = Elt.{ name; kind = kind'; pkg = None ; json_display ; has_doc} in

register_doc elt doc.txt ;
(match extra with
Expand Down
2 changes: 1 addition & 1 deletion test/cram/odoc.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ cp /home/emile/.opam/sherlodoc/var/cache/odig/odoc/dream/**.odocl .
page.mld
$ sherlodoc_index --format=js --db=db.js *.odocl
$ du -sh db.js
20K db.js
16K db.js
$ odoc html-generate --with-search --output-dir html main.odocl
$ odoc html-generate --with-search --output-dir html page-page.odocl
$ odoc support-files -o html
Expand Down

0 comments on commit d665c8b

Please sign in to comment.