File tree Expand file tree Collapse file tree 5 files changed +33
-23
lines changed Expand file tree Collapse file tree 5 files changed +33
-23
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,19 @@ type t = {
12
12
content_only : bool ;
13
13
}
14
14
15
- let v ?theme_uri ?support_uri ~semantic_uris ~indent ~flat ~open_details ~omit_breadcrumbs ~omit_toc ~content_only () =
16
- { theme_uri; support_uri; semantic_uris; indent; flat; open_details; omit_breadcrumbs; omit_toc; content_only }
15
+ let v ?theme_uri ?support_uri ~semantic_uris ~indent ~flat ~open_details
16
+ ~omit_breadcrumbs ~omit_toc ~content_only () =
17
+ {
18
+ theme_uri;
19
+ support_uri;
20
+ semantic_uris;
21
+ indent;
22
+ flat;
23
+ open_details;
24
+ omit_breadcrumbs;
25
+ omit_toc;
26
+ content_only;
27
+ }
17
28
18
29
let theme_uri config =
19
30
match config.theme_uri with None -> Types. Relative None | Some uri -> uri
@@ -33,4 +44,4 @@ let omit_breadcrumbs config = config.omit_breadcrumbs
33
44
34
45
let omit_toc config = config.omit_toc
35
46
36
- let content_only config = config.content_only
47
+ let content_only config = config.content_only
Original file line number Diff line number Diff line change @@ -130,7 +130,9 @@ let page_creator ~config ~url name header toc content =
130
130
make_navigation ~up_url l
131
131
in
132
132
133
- let breadcrumbs = if Config. omit_breadcrumbs config then [] else gen_breadcrumbs () in
133
+ let breadcrumbs =
134
+ if Config. omit_breadcrumbs config then [] else gen_breadcrumbs ()
135
+ in
134
136
let toc = if Config. omit_toc config then [] else html_of_toc toc in
135
137
let body =
136
138
breadcrumbs
@@ -140,15 +142,15 @@ let page_creator ~config ~url name header toc content =
140
142
in
141
143
let htmlpp_elt = Html. pp_elt ~indent: (Config. indent config) () in
142
144
let htmlpp = Html. pp ~indent: (Config. indent config) () in
143
- if Config. content_only config
144
- then begin
145
- let content ppf = htmlpp_elt ppf (Html. div ~a: [ Html. a_class [ " odoc" ] ] body) in
145
+ if Config. content_only config then
146
+ let content ppf =
147
+ htmlpp_elt ppf (Html. div ~a: [ Html. a_class [ " odoc" ] ] body)
148
+ in
146
149
content
147
- end else begin
150
+ else
148
151
let html = Html. html head (Html. body ~a: [ Html. a_class [ " odoc" ] ] body) in
149
152
let content ppf = htmlpp ppf html in
150
153
content
151
- end
152
154
153
155
let make ~config ~url ~header ~toc title content children =
154
156
let filename = Link.Path. as_filename ~is_flat: (Config. flat config) url in
Original file line number Diff line number Diff line change @@ -517,25 +517,22 @@ module Odoc_html_args = struct
517
517
Arg. (value & flag & info ~docs ~doc [ " flat" ])
518
518
519
519
let omit_breadcrumbs =
520
- let doc =
521
- " Don't emit the breadcrumbs navigation element"
522
- in
523
- Arg. (value & flag & info ~docs ~doc [ " omit-breadcrumbs" ])
520
+ let doc = " Don't emit the breadcrumbs navigation element" in
521
+ Arg. (value & flag & info ~docs ~doc [ " omit-breadcrumbs" ])
524
522
525
523
let omit_toc =
526
- let doc =
527
- " Don't emit the table of contents div"
528
- in
529
- Arg. (value & flag & info ~docs ~doc [ " omit-toc" ])
524
+ let doc = " Don't emit the table of contents div" in
525
+ Arg. (value & flag & info ~docs ~doc [ " omit-toc" ])
530
526
531
527
let content_only =
532
- let doc =
528
+ let doc =
533
529
" Only emit the content of the page, not the html, head and body elements"
534
530
in
535
- Arg. (value & flag & info ~docs ~doc [ " content-only" ])
536
-
531
+ Arg. (value & flag & info ~docs ~doc [ " content-only" ])
532
+
537
533
let extra_args =
538
- let config semantic_uris closed_details indent theme_uri support_uri flat omit_breadcrumbs omit_toc content_only =
534
+ let config semantic_uris closed_details indent theme_uri support_uri flat
535
+ omit_breadcrumbs omit_toc content_only =
539
536
let open_details = not closed_details in
540
537
Odoc_html.Config. v ~theme_uri ~support_uri ~semantic_uris ~indent ~flat
541
538
~open_details ~omit_breadcrumbs ~omit_toc ~content_only ()
Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ let from_mld ~xref_base_uri ~resolver ~output ~warnings_options input =
26
26
let page = Odoc_document.Comment. to_ir resolved.content in
27
27
let config =
28
28
Odoc_html.Config. v ~semantic_uris: false ~indent: false ~flat: false
29
- ~open_details: false ~omit_breadcrumbs: false ~omit_toc: false ~content_only: false ()
29
+ ~open_details: false ~omit_breadcrumbs: false ~omit_toc: false
30
+ ~content_only: false ()
30
31
in
31
32
let html = Odoc_html.Generator. doc ~config ~xref_base_uri page in
32
33
let oc = open_out (Fs.File. to_string output) in
Original file line number Diff line number Diff line change 30
30
31
31
(cram
32
32
(deps %{bin:odoc}))
33
-
You can’t perform that action at this time.
0 commit comments