Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remap mode fixes #1265

Merged
merged 2 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion doc/dune
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,7 @@

(install
(section doc)
(files odoc-config.sexp (odoc_logo_placeholder.jpg as odoc-pages/odoc_logo_placeholder.jpg))
(files
odoc-config.sexp
(odoc_logo_placeholder.jpg as odoc-pages/odoc_logo_placeholder.jpg))
(package odoc))
4 changes: 3 additions & 1 deletion src/driver/landing_pages.ml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ let package_list ~dirs all =
all |> List.sort (fun n1 n2 -> String.compare n1.name n2.name)
in
fpf ppf "{0 List of all packages}@\n";
let print_pkg pkg = fpf ppf "- {{:%s/index.html}%s}@\n" pkg.name pkg.name in
let print_pkg pkg =
if pkg.selected then fpf ppf "- {{:%s/index.html}%s}@\n" pkg.name pkg.name
in
List.iter print_pkg sorted_packages
in
let content = content all in
Expand Down
3 changes: 2 additions & 1 deletion src/driver/odoc_driver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ let render_stats env ~generate_json nprocs =
indexes (i' - i);
html (g' - g);
procs (h' - h);
if g' < total_generate then
if not Stats.stats.finished then
inner (a', b', c', j', d', e', f', i', g', h')
in
inner (0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
Expand Down Expand Up @@ -251,6 +251,7 @@ let run mode
html_dir linked
in
let _ = Odoc.support_files html_dir in
Stats.stats.finished <- true;
())
(fun () -> render_stats env ~generate_json nb_workers)
in
Expand Down
10 changes: 7 additions & 3 deletions src/driver/odoc_units_of.ml
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,11 @@ let packages ~dirs ~extra_paths ~remap (pkgs : Packages.t list) : t list =
lib_deps pkg.Packages.libraries
in
let index = index_of pkg in
let landing_page :> t = Landing_pages.library ~dirs ~pkg ~index lib in
landing_page :: List.concat_map (of_module pkg lib lib_deps) lib.modules
let units = List.concat_map (of_module pkg lib lib_deps) lib.modules in
if pkg.selected then
let landing_page :> t = Landing_pages.library ~dirs ~pkg ~index lib in
landing_page :: units
else units
in
let of_mld pkg (mld : Packages.mld) : mld unit list =
let open Fpath in
Expand Down Expand Up @@ -265,7 +268,7 @@ let packages ~dirs ~extra_paths ~remap (pkgs : Packages.t list) : t list =
(Fpath.normalize (Fpath.v "./index.mld")))
pkg.mlds
in
if has_index_page then []
if has_index_page || not pkg.selected then []
else
let index = index_of pkg in
[ Landing_pages.package ~dirs ~pkg ~index ]
Expand All @@ -282,6 +285,7 @@ let packages ~dirs ~extra_paths ~remap (pkgs : Packages.t list) : t list =
| _ -> false)
lib.Packages.modules)
pkg.libraries
&& pkg.selected
then
let index = index_of pkg in
[ Landing_pages.src ~dirs ~pkg ~index ]
Expand Down
2 changes: 2 additions & 0 deletions src/driver/stats.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type stats = {
mutable generated_units : int Atomic.t;
mutable processes : int Atomic.t;
mutable process_activity : string Atomic.t Array.t;
mutable finished : bool;
}

let stats =
Expand All @@ -41,6 +42,7 @@ let stats =
generated_indexes = Atomic.make 0;
processes = Atomic.make 0;
process_activity = [||];
finished = false;
}

let init_nprocs nprocs =
Expand Down
Loading