File tree Expand file tree Collapse file tree 7 files changed +27
-13
lines changed Expand file tree Collapse file tree 7 files changed +27
-13
lines changed Original file line number Diff line number Diff line change
1
+ type t = (string * string ) list
Original file line number Diff line number Diff line change @@ -527,10 +527,6 @@ end =
527
527
module rec Page : sig
528
528
type child = Page_child of string | Module_child of string
529
529
530
- module Frontmatter : sig
531
- type t = (string * string ) list
532
- end
533
-
534
530
type t = {
535
531
name : Identifier.Page .t ;
536
532
root : Root .t ;
Original file line number Diff line number Diff line change 29
29
module Odoc_file = struct
30
30
type compilation_unit = { name : string ; hidden : bool }
31
31
32
- type page = { name : string ; title : Comment .link_content option }
32
+ type page = {
33
+ name : string ;
34
+ title : Comment .link_content option ;
35
+ frontmatter : Frontmatter .t option ;
36
+ }
33
37
34
38
type t =
35
39
| Page of page
@@ -41,7 +45,7 @@ module Odoc_file = struct
41
45
let hidden = force_hidden || Names. contains_double_underscore name in
42
46
Compilation_unit { name; hidden }
43
47
44
- let create_page name title = Page { name; title }
48
+ let create_page name title frontmatter = Page { name; title; frontmatter }
45
49
46
50
let create_impl name = Impl name
47
51
Original file line number Diff line number Diff line change 28
28
module Odoc_file : sig
29
29
type compilation_unit = { name : string ; hidden : bool }
30
30
31
- type page = { name : string ; title : Comment .link_content option }
31
+ type page = {
32
+ name : string ;
33
+ title : Comment .link_content option ;
34
+ frontmatter : Frontmatter .t option ;
35
+ }
32
36
33
37
type t =
34
38
| Page of page
@@ -38,7 +42,8 @@ module Odoc_file : sig
38
42
39
43
val create_unit : force_hidden :bool -> string -> t
40
44
41
- val create_page : string -> Comment .link_content option -> t
45
+ val create_page :
46
+ string -> Comment .link_content option -> Frontmatter .t option -> t
42
47
43
48
val create_impl : string -> t
44
49
Original file line number Diff line number Diff line change @@ -697,6 +697,10 @@ and page_t =
697
697
[
698
698
F (" name" , (fun t -> t.name), identifier);
699
699
F (" root" , (fun t -> t.root), root);
700
+ F
701
+ ( " frontmatter" ,
702
+ (fun t -> t.frontmatter),
703
+ Option (List (Pair (string , string ))) );
700
704
F (" content" , (fun t -> t.content), docs);
701
705
F (" digest" , (fun t -> t.digest), Digest. t);
702
706
]
Original file line number Diff line number Diff line change @@ -240,7 +240,9 @@ let mld ~parent_id ~parents_children ~output ~children ~warnings_options input =
240
240
let zero_heading = Comment. find_zero_heading content in
241
241
let frontmatter, content = Comment. extract_frontmatter content in
242
242
let root =
243
- let file = Root.Odoc_file. create_page root_name zero_heading in
243
+ let file =
244
+ Root.Odoc_file. create_page root_name zero_heading frontmatter
245
+ in
244
246
{ Root. id = (name :> Paths.Identifier.OdocId.t ); file; digest }
245
247
in
246
248
let page =
Original file line number Diff line number Diff line change @@ -9,13 +9,15 @@ let from_mld ~xref_base_uri ~resolver ~output ~warnings_options input =
9
9
in
10
10
let input_s = Fs.File. to_string input in
11
11
let digest = Digest. file input_s in
12
- let root =
13
- let file = Odoc_model.Root.Odoc_file. create_page page_name None in
14
- { Odoc_model.Root. id; file; digest }
15
- in
16
12
let to_html content =
17
13
(* This is a mess. *)
18
14
let frontmatter, content = Odoc_model.Comment. extract_frontmatter content in
15
+ let root =
16
+ let file =
17
+ Odoc_model.Root.Odoc_file. create_page page_name None frontmatter
18
+ in
19
+ { Odoc_model.Root. id; file; digest }
20
+ in
19
21
let page =
20
22
Odoc_model.Lang.Page.
21
23
{
You can’t perform that action at this time.
0 commit comments