Skip to content

Commit

Permalink
Driver: Only output simplified search json in voodoo mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jonludlam committed Jan 22, 2025
1 parent d2023e0 commit 8ae410f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/driver/bin/odoc_driver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ let run_inner ~odoc_dir ~odocl_dir ~index_dir ~mld_dir ~compile_grep ~link_grep
output
in
let () =
Compile.html_generate ~occurrence_file ~remaps ~generate_json html_dir
linked
Compile.html_generate ~occurrence_file ~remaps ~generate_json
~simplified_search_output:false html_dir linked
in
let _ = Odoc.support_files html_dir in
Stats.stats.finished <- true;
Expand Down
2 changes: 1 addition & 1 deletion src/driver/bin/odoc_driver_monorepo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ let run path extra_pkgs extra_libs
in
let () =
Compile.html_generate ~occurrence_file ~remaps:[] ~generate_json
html_dir linked
~simplified_search_output:false html_dir linked
in
let _ = Odoc.support_files html_dir in
Stats.stats.finished <- true;
Expand Down
2 changes: 1 addition & 1 deletion src/driver/bin/odoc_driver_voodoo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ let run package_name blessed actions odoc_dir odocl_dir
in
let () =
Compile.html_generate ~occurrence_file ~remaps:[] ~generate_json
html_dir linked
~simplified_search_output:true html_dir linked
in
let _ = Odoc.support_files html_dir in
()
Expand Down
10 changes: 6 additions & 4 deletions src/driver/compile.ml
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ let sherlodoc_index_one ~output_dir (index : Odoc_unit.index) =
Sherlodoc.index ~format:`js ~inputs ~dst ();
rel_path

let html_generate ~occurrence_file ~remaps ~generate_json output_dir linked =
let html_generate ~occurrence_file ~remaps ~generate_json
~simplified_search_output output_dir linked =
let tbl = Hashtbl.create 10 in
let _ = OS.Dir.create output_dir |> Result.get_ok in
Sherlodoc.js Fpath.(output_dir // Sherlodoc.js_file);
Expand All @@ -303,9 +304,10 @@ let html_generate ~occurrence_file ~remaps ~generate_json output_dir linked =
Odoc.sidebar_generate
~output_file:Fpath.(output_dir // pkg_dir / "sidebar.json")
~json:true index.output_file ();
Odoc.compile_index ~json:true ~occurrence_file
~output_file:Fpath.(output_dir // pkg_dir / "index.js")
~simplified:true ~wrap:true ~roots ();
if simplified_search_output then
Odoc.compile_index ~json:true ~occurrence_file
~output_file:Fpath.(output_dir // pkg_dir / "index.js")
~simplified:true ~wrap:true ~roots ();

Some output_file
in
Expand Down
1 change: 1 addition & 0 deletions src/driver/compile.mli
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ val html_generate :
occurrence_file:Fpath.t ->
remaps:(string * string) list ->
generate_json:bool ->
simplified_search_output:bool ->
Fpath.t ->
linked list ->
unit

0 comments on commit 8ae410f

Please sign in to comment.