File tree Expand file tree Collapse file tree 3 files changed +24
-15
lines changed
Expand file tree Collapse file tree 3 files changed +24
-15
lines changed Original file line number Diff line number Diff line change @@ -41,17 +41,17 @@ let convert_fpath =
4141let convert_src_fpath =
4242 let parse inp =
4343 match Arg. (conv_parser file) inp with
44- | Ok s -> Result. Ok (Html_page. File (Fs.File. of_string s))
44+ | Ok s -> Result. Ok (Html_page.Source. File (Fs.File. of_string s))
4545 | Error _ as e -> e
46- and print = Html_page. pp in
46+ and print = Html_page.Source. pp in
4747 Arg. conv (parse, print)
4848
4949let convert_src_dir =
5050 let parse inp =
5151 match Arg. (conv_parser dir) inp with
52- | Ok s -> Result. Ok (Html_page. Root (Fs.File. of_string s))
52+ | Ok s -> Result. Ok (Html_page.Source. Root (Fs.File. of_string s))
5353 | Error _ as e -> e
54- and print = Html_page. pp in
54+ and print = Html_page.Source. pp in
5555 Arg. conv (parse, print)
5656
5757(* * On top of the conversion 'string', split into segs. *)
@@ -743,8 +743,9 @@ module Odoc_html_args = struct
743743
744744 let source_root =
745745 let doc =
746- " Source code root for the compilation unit. It must have been compiled \
747- with --source-parent passed."
746+ " Source code root for the compilation unit. Used to find the source file \
747+ from the value of --source-name it was compiled with. Incompatible with \
748+ --source-file."
748749 in
749750 Arg. (
750751 value
Original file line number Diff line number Diff line change 1616
1717open Odoc_model
1818
19- type source = File of Fpath .t | Root of Fpath .t
19+ module Source = struct
20+ type t = File of Fpath .t | Root of Fpath .t
2021
21- let pp fmt = function
22- | File f -> Format. fprintf fmt " File: %a" Fpath. pp f
23- | Root f -> Format. fprintf fmt " File: %a" Fpath. pp f
22+ let pp fmt = function
23+ | File f -> Format. fprintf fmt " File: %a" Fpath. pp f
24+ | Root f -> Format. fprintf fmt " File: %a" Fpath. pp f
2425
25- let to_string f = Format. asprintf " %a" pp f
26+ let to_string f = Format. asprintf " %a" pp f
27+ end
28+
29+ type source = Source .t
2630
2731type args = {
2832 html_config : Odoc_html.Config .t ;
@@ -38,7 +42,7 @@ let source_documents source_info source ~syntax =
3842 | Some { Lang.Source_info. id; infos } , Some src -> (
3943 let file =
4044 match src with
41- | File f -> f
45+ | Source. File f -> f
4246 | Root f ->
4347 let open Odoc_model.Paths.Identifier in
4448 let rec get_path_dir : SourceDir.t -> Fpath.t = function
@@ -78,7 +82,7 @@ let source_documents source_info source ~syntax =
7882 (Error. filename_only
7983 " --source argument is invalid on compilation unit that were not \
8084 compiled with --source-parent and --source-name"
81- (to_string src));
85+ (Source. to_string src));
8286 []
8387 | None , None -> []
8488
Original file line number Diff line number Diff line change 1616
1717open Odoc_document
1818
19- type source = File of Fpath .t | Root of Fpath .t
19+ module Source : sig
20+ type t = File of Fpath .t | Root of Fpath .t
2021
21- val pp : Format .formatter -> source -> unit
22+ val pp : Format .formatter -> t -> unit
23+ end
24+
25+ type source = Source .t
2226
2327type args = {
2428 html_config : Odoc_html.Config .t ;
You can’t perform that action at this time.
0 commit comments