[OCaml] Mobile-friendly clone of cgit.
1
(** The page shell: everything that surrounds a page's own content.
2
3
Pages hand this module a {!body_data} description and receive a complete
4
document. The shell decides which navigation applies, whether a toolbar is
5
present, and what goes in the head — pages never assemble those themselves.
6
*)
7
8
(** {1 Re-exported types} *)
9
10
type page = Components.page =
11
| Summary
12
| Commits
13
| Files (** Which repository page is being shown. *)
14
15
type site = Components.site = {
16
user_name : string;
17
root_title : string;
18
nav_logo : string;
19
}
20
(** Site-wide presentation settings. *)
21
22
val site : user_name:string -> root_title:string -> nav_logo:string -> site
23
(** Construct a {!site} record. *)
24
25
(** {1 Page data} *)
26
27
type body_data = {
28
title : string;
29
repo : string option;
30
subtitle : string;
31
active : page;
32
toolbar : Ui.node list;
33
content : Ui.node list;
34
home_href : string option;
35
}
36
(** Everything the shell needs to wrap a page's content in the standard document
37
structure. *)
38
39
(** {1 Rendering} *)
40
41
val render : ?page_title:string -> site -> body_data -> Ui.node
42
(** Produce a complete HTML document from a page description. [page_title]
43
becomes the [<title>] element (default ["Ogit"]). *)
44