generate.ml 869 Bytes
Newer Older
1
open Html5.M
François Bobot's avatar
François Bobot committed
2
open Menu
3

François Bobot's avatar
François Bobot committed
4
5
6
7
8
9
10
let internal_link ?(a=[]) p text =
  Html5.M.a ~a:(a_href (p.filename^".html")::a_title p.long_title::a)
    [pcdata text]

let page p b =
  let header =
    div ~a:[a_id "Header"]
François Bobot's avatar
François Bobot committed
11
12
13
      [internal_link ~a:[a_style "font-size: 200%; margin-right:10px;"]
         main "SOPRANO";
       pcdata (p.long_title)] in
François Bobot's avatar
François Bobot committed
14
  let menu =
François Bobot's avatar
François Bobot committed
15
16
    (List.fold_right (fun p acc -> internal_link p p.menu_title::br ()::acc))
      menu []
François Bobot's avatar
François Bobot committed
17
18
19
  in
  let menu = div ~a:[a_id "Menu"] menu in
  let content = div ~a:[a_id "Content"] b in
20
21
  let html =
    html
François Bobot's avatar
François Bobot committed
22
23
24
25
26
27
      (head (title (pcdata ("SOPRANO: "^p.long_title)))
         [
           meta ~a:[a_charset "utf-8"] ();
           link ~rel:[`Stylesheet] ~href:"css/main.css" ()
         ])
      (body ([header;content;menu])) in
28
  Html5.P.print ~output:print_string html
François Bobot's avatar
François Bobot committed
29
30

type a_remplir = ARemplir (** For the squeleton *)