Skip to content

Commit 3e4c67a

Browse files
committed
Allow multiple output files
1 parent d4a8c50 commit 3e4c67a

File tree

8 files changed

+12
-15
lines changed

8 files changed

+12
-15
lines changed

src/document/renderer.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ let traverse ~f t =
1515
f node.filename node.content;
1616
List.iter aux node.children
1717
in
18-
aux t
18+
List.iter aux t
1919

2020
type 'a t = {
2121
name : string;
22-
render : 'a -> Types.Page.t -> page;
22+
render : 'a -> Types.Page.t -> page list;
2323
files_of_url : Url.Path.t -> Fpath.t list;
2424
}
2525

src/html/generator.ml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -375,12 +375,12 @@ module Page = struct
375375
| `Inline -> Some 0)
376376

377377
let rec include_ ?theme_uri indent { Subpage.content; _ } =
378-
[ page ?theme_uri indent content ]
378+
page ?theme_uri indent content
379379

380380
and subpages ?theme_uri indent subpages =
381381
Utils.list_concat_map ~f:(include_ ?theme_uri indent) subpages
382382

383-
and page ?theme_uri ?support_uri indent p =
383+
and page ?theme_uri ?support_uri indent p : Odoc_document.Renderer.page list =
384384
let { Page.title; header; items = i; url } =
385385
Doctree.Labels.disambiguate_page p
386386
and subpages =
@@ -393,11 +393,8 @@ module Page = struct
393393
let toc = Toc.from_items ~resolve ~path:url i in
394394
let header = items ~resolve header in
395395
let content = (items ~resolve i :> any Html.elt list) in
396-
let page =
397-
Tree.make ?theme_uri ?support_uri ~indent ~header ~toc ~url title content
398-
subpages
399-
in
400-
page
396+
Tree.make ?theme_uri ?support_uri ~indent ~header ~toc ~url title content
397+
subpages
401398
end
402399

403400
let render ?theme_uri ?support_uri ~indent page =

src/html/generator.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ val render :
55
?support_uri:Tree.uri ->
66
indent:bool ->
77
Types.Page.t ->
8-
Renderer.page
8+
Renderer.page list
99

1010
val doc :
1111
xref_base_uri:string ->

src/html/tree.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,6 @@ let make ?theme_uri ?support_uri ~indent ~url ~header ~toc title content
131131
page_creator ?theme_uri ?support_uri ~url title header toc content
132132
in
133133
let content ppf = (Html.pp ~indent ()) ppf html in
134-
{ Odoc_document.Renderer.filename; content; children }
134+
[ { Odoc_document.Renderer.filename; content; children } ]
135135

136136
let open_details = ref true

src/html/tree.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ val make :
3737
string ->
3838
Html_types.div_content Html.elt list ->
3939
Renderer.page list ->
40-
Renderer.page
40+
Renderer.page list
4141
(** [make ?theme_uri (body, children)] calls "the page creator" to turn [body]
4242
into an [[ `Html ] elt]. If [theme_uri] is provided, it will be used to
4343
locate the theme files, otherwise the HTML output directory is used. *)

src/latex/generator.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ module Page = struct
462462
page
463463
end
464464

465-
let render ~with_children page = Page.page ~with_children page
465+
let render ~with_children page = [ Page.page ~with_children page ]
466466

467467
let files_of_url url =
468468
if Link.is_class_or_module_path url then [ Link.filename url ] else []

src/latex/generator.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ val files_of_url : Odoc_document.Url.Path.t -> Fpath.t list
77
val render :
88
with_children:bool ->
99
Odoc_document.Types.Page.t ->
10-
Odoc_document.Renderer.page
10+
Odoc_document.Renderer.page list

src/odoc/man_page.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
open Odoc_document
22

3-
let render _ page = Odoc_manpage.Generator.render page
3+
let render _ page = [ Odoc_manpage.Generator.render page ]
44

55
let files_of_url url = Odoc_manpage.Link.files_of_url url
66

0 commit comments

Comments
 (0)