File tree Expand file tree Collapse file tree 3 files changed +34
-7
lines changed Expand file tree Collapse file tree 3 files changed +34
-7
lines changed Original file line number Diff line number Diff line change @@ -236,7 +236,7 @@ let html_generate output_dir linked =
236
236
match l.kind with
237
237
| `Intf { hidden = true ; _ } -> ()
238
238
| `Impl { src_path; _ } ->
239
- Odoc. html_generate ~search_uris: [] ~output_dir ~input_file
239
+ Odoc. html_generate_impl ~search_uris: [] ~output_dir ~input_file
240
240
~source: src_path () ;
241
241
Atomic. incr Stats. stats.generated_units
242
242
| _ ->
Original file line number Diff line number Diff line change @@ -130,11 +130,8 @@ let compile_index ?(ignore_output = false) ~output_file ~json ~docs ~libs () =
130
130
add_prefixed_output cmd link_output (Fpath. to_string output_file) lines)
131
131
132
132
let html_generate ~output_dir ?index ?(ignore_output = false ) ?(assets = [] )
133
- ?source ? (search_uris = [] ) ~input_file :file () =
133
+ ?(search_uris = [] ) ~input_file :file () =
134
134
let open Cmd in
135
- let source =
136
- match source with None -> empty | Some source -> v " --source" % p source
137
- in
138
135
let index =
139
136
match index with None -> empty | Some idx -> v " --index" % p idx
140
137
in
@@ -147,8 +144,29 @@ let html_generate ~output_dir ?index ?(ignore_output = false) ?(assets = [])
147
144
empty search_uris
148
145
in
149
146
let cmd =
150
- ! odoc % " html-generate" %% source % p file %% assets %% index %% search_uris
151
- % " -o" % output_dir
147
+ ! odoc % " html-generate" % p file %% assets %% index %% search_uris % " -o"
148
+ % output_dir
149
+ in
150
+ let desc = Printf. sprintf " Generating HTML for %s" (Fpath. to_string file) in
151
+ let lines = Cmd_outputs. submit desc cmd None in
152
+ if not ignore_output then
153
+ Cmd_outputs. (
154
+ add_prefixed_output cmd generate_output (Fpath. to_string file) lines)
155
+
156
+ let html_generate_impl ~output_dir ?(ignore_output = false ) ?source
157
+ ?(search_uris = [] ) ~input_file :file () =
158
+ let open Cmd in
159
+ let source =
160
+ match source with None -> empty | Some source -> v " --source" % p source
161
+ in
162
+ let search_uris =
163
+ List. fold_left
164
+ (fun acc filename -> acc % " --search-uri" % p filename)
165
+ empty search_uris
166
+ in
167
+ let cmd =
168
+ ! odoc % " html-generate-impl" %% source % p file %% search_uris % " -o"
169
+ % output_dir
152
170
in
153
171
let desc = Printf. sprintf " Generating HTML for %s" (Fpath. to_string file) in
154
172
let lines = Cmd_outputs. submit desc cmd None in
Original file line number Diff line number Diff line change @@ -49,11 +49,20 @@ val html_generate :
49
49
?index : Fpath .t ->
50
50
?ignore_output : bool ->
51
51
?assets : string list ->
52
+ ?search_uris : Fpath .t list ->
53
+ input_file :Fpath .t ->
54
+ unit ->
55
+ unit
56
+
57
+ val html_generate_impl :
58
+ output_dir :string ->
59
+ ?ignore_output : bool ->
52
60
?source : Fpath .t ->
53
61
?search_uris : Fpath .t list ->
54
62
input_file :Fpath .t ->
55
63
unit ->
56
64
unit
65
+
57
66
val support_files : Fpath .t -> string list
58
67
59
68
val count_occurrences : Fpath .t -> string list
You can’t perform that action at this time.
0 commit comments