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 =
41
41
let convert_src_fpath =
42
42
let parse inp =
43
43
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))
45
45
| Error _ as e -> e
46
- and print = Html_page. pp in
46
+ and print = Html_page.Source. pp in
47
47
Arg. conv (parse, print)
48
48
49
49
let convert_src_dir =
50
50
let parse inp =
51
51
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))
53
53
| Error _ as e -> e
54
- and print = Html_page. pp in
54
+ and print = Html_page.Source. pp in
55
55
Arg. conv (parse, print)
56
56
57
57
(* * On top of the conversion 'string', split into segs. *)
@@ -743,8 +743,9 @@ module Odoc_html_args = struct
743
743
744
744
let source_root =
745
745
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."
748
749
in
749
750
Arg. (
750
751
value
Original file line number Diff line number Diff line change 16
16
17
17
open Odoc_model
18
18
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
20
21
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
24
25
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
26
30
27
31
type args = {
28
32
html_config : Odoc_html.Config .t ;
@@ -38,7 +42,7 @@ let source_documents source_info source ~syntax =
38
42
| Some { Lang.Source_info. id; infos } , Some src -> (
39
43
let file =
40
44
match src with
41
- | File f -> f
45
+ | Source. File f -> f
42
46
| Root f ->
43
47
let open Odoc_model.Paths.Identifier in
44
48
let rec get_path_dir : SourceDir.t -> Fpath.t = function
@@ -78,7 +82,7 @@ let source_documents source_info source ~syntax =
78
82
(Error. filename_only
79
83
" --source argument is invalid on compilation unit that were not \
80
84
compiled with --source-parent and --source-name"
81
- (to_string src));
85
+ (Source. to_string src));
82
86
[]
83
87
| None , None -> []
84
88
Original file line number Diff line number Diff line change 16
16
17
17
open Odoc_document
18
18
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
20
21
21
- val pp : Format .formatter -> source -> unit
22
+ val pp : Format .formatter -> t -> unit
23
+ end
24
+
25
+ type source = Source .t
22
26
23
27
type args = {
24
28
html_config : Odoc_html.Config .t ;
You can’t perform that action at this time.
0 commit comments