File tree Expand file tree Collapse file tree 1 file changed +24
-15
lines changed Expand file tree Collapse file tree 1 file changed +24
-15
lines changed Original file line number Diff line number Diff line change @@ -297,23 +297,32 @@ let of_libs libs =
297
297
in
298
298
ignore libname_of_archive;
299
299
let mk_mlds pkg_name libraries odoc_pages =
300
+ let prefix = Fpath. (v (Opam. prefix () ) / " doc" / pkg_name / " odoc-pages" ) in
300
301
Fpath.Set. fold
301
302
(fun mld_path acc ->
302
- let mld_parent_id = Printf. sprintf " %s/doc" pkg_name in
303
- let page_name = Fpath. (rem_ext mld_path |> filename) in
304
- let odoc_file =
305
- Fpath. (v mld_parent_id / (" page-" ^ page_name ^ " .odoc" ))
306
- in
307
- let odocl_file = Fpath. (set_ext " odocl" odoc_file) in
308
- let mld_deps = List. map (fun l -> l.odoc_dir) libraries in
309
- {
310
- mld_odoc_file = odoc_file;
311
- mld_odocl_file = odocl_file;
312
- mld_parent_id;
313
- mld_path;
314
- mld_deps;
315
- }
316
- :: acc)
303
+ let rel_path = Fpath. rem_prefix prefix mld_path in
304
+ match rel_path with
305
+ | None -> acc
306
+ | Some rel_path ->
307
+ let id = Fpath. (v pkg_name / " doc" // rel_path) in
308
+ let mld_parent_id =
309
+ Format. asprintf " %a" Fpath. pp
310
+ (id |> Fpath. parent |> Fpath. rem_empty_seg)
311
+ in
312
+ let page_name = Fpath. (rem_ext mld_path |> filename) in
313
+ let odoc_file =
314
+ Fpath. (v mld_parent_id / (" page-" ^ page_name ^ " .odoc" ))
315
+ in
316
+ let odocl_file = Fpath. (set_ext " odocl" odoc_file) in
317
+ let mld_deps = List. map (fun l -> l.odoc_dir) libraries in
318
+ {
319
+ mld_odoc_file = odoc_file;
320
+ mld_odocl_file = odocl_file;
321
+ mld_parent_id;
322
+ mld_path;
323
+ mld_deps;
324
+ }
325
+ :: acc)
317
326
odoc_pages []
318
327
in
319
328
let update_mlds mlds libraries =
You can’t perform that action at this time.
0 commit comments