File: minihtml.re

package info (click to toggle)
tyxml 4.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 944 kB
  • sloc: ml: 9,712; makefile: 91; javascript: 3
file content (22 lines) | stat: -rw-r--r-- 478 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
open Tyxml;

let mycontent =
  <div className="content">
    <h1> "A fabulous title" </h1>
    "This is a fabulous content."
  </div>;

let mytitle = Html.txt("A Fabulous Web Page");

let mypage =
  <html>
    <head> <title> mytitle </title> </head>
    <body> mycontent </body>
  </html>;

let () = {
  let file = open_out("index.html");
  let fmt = Format.formatter_of_out_channel(file);
  Format.fprintf(fmt, "%a@.", Html.pp(~indent=true, ()), mypage);
  close_out(file);
};