File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -340,10 +340,10 @@ module Odoc_latex : sig
340
340
val info : Term .info
341
341
end = struct
342
342
343
- let latex directories output_dir syntax input_file =
343
+ let latex directories output_dir syntax with_children input_file =
344
344
let env = Env. create ~important_digests: false ~directories in
345
345
let file = Fs.File. of_string input_file in
346
- Latex. from_odoc ~env ~syntax ~output: output_dir file
346
+ Latex. from_odoc ~env ~syntax ~output: output_dir ~with_children file
347
347
348
348
let cmd =
349
349
let input =
@@ -356,9 +356,14 @@ end = struct
356
356
in
357
357
Arg. (value & opt (pconv convert_syntax) (Odoc_document.Renderer. OCaml ) @@ info ~docv: " SYNTAX" ~doc ~env [" syntax" ])
358
358
in
359
+ let with_children =
360
+ let doc = " Include children at the end of the page" in
361
+ Arg. (value & opt bool true & info ~docv: " BOOL" ~doc [" with-children" ])
362
+ in
359
363
Term. (const handle_error $ (const latex $
360
364
odoc_file_directories $ dst ~create: true () $
361
365
syntax $
366
+ with_children $
362
367
input))
363
368
364
369
let info =
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ let traverse ~f t =
64
64
aux [] t
65
65
66
66
67
- let from_odoc ~env ?(syntax =Renderer. OCaml ) ~output :root_dir input =
67
+ let from_odoc ~env ?(syntax =Renderer. OCaml ) ?( with_children = true ) ~output :root_dir input =
68
68
Root. read input >> = fun root ->
69
69
match root.file with
70
70
| Page page_name ->
@@ -88,7 +88,7 @@ let from_odoc ~env ?(syntax=Renderer.OCaml) ~output:root_dir input =
88
88
let page_name = String. concat ~sep: " ." (List. rev @@ name :: parents) in
89
89
with_tex_file ~pkg_dir ~page_name (fun ppf ->
90
90
content ppf;
91
- link_children pkg_dir parents name children_names ppf
91
+ if with_children then link_children pkg_dir parents name children_names ppf
92
92
)
93
93
);
94
94
Ok ()
You can’t perform that action at this time.
0 commit comments