Skip to content

Commit 2a44c76

Browse files
committed
Formatting
1 parent b47663e commit 2a44c76

File tree

5 files changed

+33
-23
lines changed

5 files changed

+33
-23
lines changed

src/html/config.ml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,19 @@ type t = {
1212
content_only : bool;
1313
}
1414

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+
}
1728

1829
let theme_uri config =
1930
match config.theme_uri with None -> Types.Relative None | Some uri -> uri
@@ -33,4 +44,4 @@ let omit_breadcrumbs config = config.omit_breadcrumbs
3344

3445
let omit_toc config = config.omit_toc
3546

36-
let content_only config = config.content_only
47+
let content_only config = config.content_only

src/html/tree.ml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ let page_creator ~config ~url name header toc content =
130130
make_navigation ~up_url l
131131
in
132132

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
134136
let toc = if Config.omit_toc config then [] else html_of_toc toc in
135137
let body =
136138
breadcrumbs
@@ -140,15 +142,15 @@ let page_creator ~config ~url name header toc content =
140142
in
141143
let htmlpp_elt = Html.pp_elt ~indent:(Config.indent config) () in
142144
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
146149
content
147-
end else begin
150+
else
148151
let html = Html.html head (Html.body ~a:[ Html.a_class [ "odoc" ] ] body) in
149152
let content ppf = htmlpp ppf html in
150153
content
151-
end
152154

153155
let make ~config ~url ~header ~toc title content children =
154156
let filename = Link.Path.as_filename ~is_flat:(Config.flat config) url in

src/odoc/bin/main.ml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -517,25 +517,22 @@ module Odoc_html_args = struct
517517
Arg.(value & flag & info ~docs ~doc [ "flat" ])
518518

519519
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" ])
524522

525523
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" ])
530526

531527
let content_only =
532-
let doc =
528+
let doc =
533529
"Only emit the content of the page, not the html, head and body elements"
534530
in
535-
Arg.(value & flag & info ~docs ~doc [ "content-only"])
536-
531+
Arg.(value & flag & info ~docs ~doc [ "content-only" ])
532+
537533
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 =
539536
let open_details = not closed_details in
540537
Odoc_html.Config.v ~theme_uri ~support_uri ~semantic_uris ~indent ~flat
541538
~open_details ~omit_breadcrumbs ~omit_toc ~content_only ()

src/odoc/html_fragment.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ let from_mld ~xref_base_uri ~resolver ~output ~warnings_options input =
2626
let page = Odoc_document.Comment.to_ir resolved.content in
2727
let config =
2828
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 ()
3031
in
3132
let html = Odoc_html.Generator.doc ~config ~xref_base_uri page in
3233
let oc = open_out (Fs.File.to_string output) in

test/generators/dune

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@
3030

3131
(cram
3232
(deps %{bin:odoc}))
33-

0 commit comments

Comments
 (0)