9 i: int; (* indentation *)
10 out: string -> unit; (* output function *)
14 i = 0; out = print_string
20 let add st = {st with i = st.i + 3}
22 let sub st = {st with i = st.i - 3}
30 P.sprintf "(%u, %u); (%u+%u, %u+%u); %s"
31 ts.T.y ts.T.x ts.T.rf ts.T.ri ts.T.cf ts.T.ci (parent ts.T.p)
34 let str = S.make 4 ' ' in
35 if tb.T.w then str.[0] <- 'W';
36 if tb.T.n then str.[1] <- 'N';
37 if tb.T.e then str.[2] <- 'E';
38 if tb.T.s then str.[3] <- 'S';
42 P.sprintf "\"%s\"" (S.concat " " tc)
45 | T.Plain s -> P.sprintf "\"%s\"" s
46 | T.Link (uri, s) -> P.sprintf "@(\"%s\" \"%s\")" uri s
49 | T.Text sl -> S.concat " + " (L.map text sl)
51 | T.Glue (Some i) -> P.sprintf "%u" i
57 (****************************************************************************)
61 P.sprintf "%s[{#%u: %s; %s; %s}\n"
62 (indent st) t.T.ti (size t.T.ts) (border t.T.tb) (css t.T.tc)
66 let close_table st t =
68 let str = P.sprintf "%s]\n" (indent st) in
72 let str = P.sprintf "%s%s\n" (indent st) (key k) in
76 let str = P.sprintf "%s%s\n" (indent st) (entry b) in
79 let close_line b st = st
81 let open_entry b st = st
83 let close_entry b st sst = st
86 F.open_table = open_table; F.close_table = close_table;
87 F.open_line = open_line; F.close_line = close_line;
88 F.open_entry = open_entry; F.close_entry = close_entry;
93 let _ = F.fold_table cb home t in ()