diff --git a/README.md b/README.md
index de0eb361cf..2d909684f3 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,4 @@
# **[odoc](https://ocaml.github.io/odoc/) : OCaml Documentation Generator**
-
diff --git a/src/driver/dune_style.ml b/src/driver/dune_style.ml
index 9241a16a7b..6c9b136b2f 100644
--- a/src/driver/dune_style.ml
+++ b/src/driver/dune_style.ml
@@ -122,7 +122,7 @@ let of_dune_build dir =
[]
(* When dune has a notion of doc assets, do something *);
pkg_dir;
- other_docs = Fpath.Set.empty;
+ other_docs = [];
config = Global_config.empty;
} )
| _ -> None)
diff --git a/src/driver/odoc.ml b/src/driver/odoc.ml
index 2a24f36ae1..d4cc7a9266 100644
--- a/src/driver/odoc.ml
+++ b/src/driver/odoc.ml
@@ -61,7 +61,7 @@ let compile_md ~output_dir ~input_file:file ~parent_id =
let _, f = Fpath.split_base file in
Some Fpath.(output_dir // Id.to_fpath parent_id // set_ext "odoc" f)
in
- let cmd = !odoc_md % Fpath.to_string file % "--output-dir" % p output_dir in
+ let cmd = !odoc_md % p file % "--output-dir" % p output_dir in
let cmd = cmd % "--parent-id" % Id.to_string parent_id in
let desc = Printf.sprintf "Compiling Markdown %s" (Fpath.to_string file) in
let lines = Cmd_outputs.submit desc cmd output_file in
diff --git a/src/driver/odoc_unit.ml b/src/driver/odoc_unit.ml
index 9f447ff918..0a27f2e0ae 100644
--- a/src/driver/odoc_unit.ml
+++ b/src/driver/odoc_unit.ml
@@ -387,9 +387,7 @@ let of_packages ~output_dir ~linked_dir ~index_dir ~extra_libs_paths
let lib_units :> t list list = List.map (of_lib pkg) pkg.libraries in
let mld_units :> t list list = List.map (of_mld pkg) pkg.mlds in
let asset_units :> t list list = List.map (of_asset pkg) pkg.assets in
- let md_units :> t list list =
- Fpath.Set.fold (fun md acc -> of_md pkg md :: acc) pkg.other_docs []
- in
+ let md_units :> t list list = List.map (of_md pkg) pkg.other_docs in
List.concat (lib_units @ mld_units @ asset_units @ md_units)
in
List.concat_map of_package pkgs
diff --git a/src/driver/packages.ml b/src/driver/packages.ml
index 85e6261e4e..6118d469e4 100644
--- a/src/driver/packages.ml
+++ b/src/driver/packages.ml
@@ -85,7 +85,7 @@ type t = {
libraries : libty list;
mlds : mld list;
assets : asset list;
- other_docs : Fpath.Set.t;
+ other_docs : Fpath.t list;
pkg_dir : Fpath.t;
config : Global_config.t;
}
@@ -103,8 +103,7 @@ let pp fmt t =
}@]"
t.name t.version (Fmt.Dump.list pp_libty) t.libraries (Fmt.Dump.list pp_mld)
t.mlds (Fmt.Dump.list pp_asset) t.assets (Fmt.Dump.list Fpath.pp)
- (Fpath.Set.elements t.other_docs)
- Fpath.pp t.pkg_dir
+ t.other_docs Fpath.pp t.pkg_dir
let maybe_prepend_top top_dir dir =
match top_dir with None -> dir | Some d -> Fpath.(d // dir)
@@ -476,6 +475,7 @@ let of_libs ~packages_dir libs =
m "%d mlds for package %s (from %d odoc_pages)"
(List.length mlds) pkg.name
(Fpath.Set.cardinal odoc_pages));
+ let other_docs = Fpath.Set.elements other_docs in
Some
{
name = pkg.name;
diff --git a/src/driver/packages.mli b/src/driver/packages.mli
index 1eab48640a..d7cfd97949 100644
--- a/src/driver/packages.mli
+++ b/src/driver/packages.mli
@@ -73,7 +73,7 @@ type t = {
libraries : libty list;
mlds : mld list;
assets : asset list;
- other_docs : Fpath.Set.t;
+ other_docs : Fpath.t list;
pkg_dir : Fpath.t;
config : Global_config.t;
}
diff --git a/src/driver/voodoo.ml b/src/driver/voodoo.ml
index 15b5926b29..8c9f7328d0 100644
--- a/src/driver/voodoo.ml
+++ b/src/driver/voodoo.ml
@@ -208,7 +208,7 @@ let process_package pkg =
libraries;
mlds;
assets;
- other_docs = Fpath.Set.empty;
+ other_docs = [];
pkg_dir = top_dir pkg;
config;
}
diff --git a/src/markdown/odoc_md.ml b/src/markdown/odoc_md.ml
index 61c5ca62dc..030bcc0815 100644
--- a/src/markdown/odoc_md.ml
+++ b/src/markdown/odoc_md.ml
@@ -9,15 +9,15 @@ let parse id input_s =
Lexing.{ pos_fname = input_s; pos_lnum = 1; pos_cnum = 0; pos_bol = 0 }
in
let str = In_channel.(with_open_bin input_s input_all) in
- let content, _warnings = Doc_of_md.parse_comment ~location ~text:str () in
- let content, () =
+ let content, parser_warnings = Doc_of_md.parse_comment ~location ~text:str () in
+ let ((content, ()), semantics_warnings) =
Semantics.ast_to_comment ~internal_tags:Expect_none ~sections_allowed:`All
- ~tags_allowed:true
+ ~tags_allowed:false
~parent_of_sections:(id :> Paths.Identifier.LabelParent.t)
content []
- |> Error.raise_warnings
+ |> Error.unpack_warnings
in
- content
+ (content, List.map Error.t_of_parser_t parser_warnings @ semantics_warnings)
let mk_page input_s id content =
(* Construct the output file representation *)
@@ -48,13 +48,13 @@ let run input_s parent_id_str odoc_dir =
(parent_id, Odoc_model.Names.PageName.make_std page_name)
in
- let content = parse id input_s in
+ let content, warnings = parse id input_s in
let page = mk_page input_s id content in
let output =
Fpath.(v odoc_dir // v parent_id_str / ("page-" ^ page_name ^ ".odoc"))
in
- Odoc_odoc.Odoc_file.save_page output ~warnings:[] page
+ Odoc_odoc.Odoc_file.save_page output ~warnings page
open Cmdliner