Commit c00c6e36 authored by bguillaum's avatar bguillaum

titles in html

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/semagramme/libcaml-grew/trunk@7418 7838e531-6607-4d57-9587-6c381814729c
parent 7ed094dd
......@@ -2,6 +2,8 @@ open Printf
open Grew_utils
open Grew_ast
(* ====================================================================================================*)
module Html = struct
let string_of_concat_item = function
......@@ -64,7 +66,6 @@ module Html = struct
| Ast.Feature_eq (qfn_l, qfn_r) -> bprintf buff "%s = %s" (string_of_qfn qfn_l) (string_of_qfn qfn_r));
bprintf buff "\n"
let buff_html_pos_pattern buff pos_pattern =
bprintf buff " <font color=\"purple\">match</font> <b>{</b>\n";
List.iter (buff_html_node buff) pos_pattern.Ast.pat_nodes;
......@@ -135,7 +136,7 @@ module Html = struct
| None -> "black"
| Some c -> c
let header buff =
let header ?title buff =
let wnl fmt = Printf.ksprintf (fun x -> Printf.bprintf buff "%s\n" x) fmt in
wnl "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">";
......@@ -143,6 +144,7 @@ module Html = struct
wnl "<html>";
wnl " <head>";
wnl " <link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\">";
(match title with Some t -> wnl " <title>%s</title>" t | None -> ());
wnl " </head>";
wnl " <body>"
......@@ -151,7 +153,8 @@ module Html = struct
let wnl fmt = Printf.ksprintf (fun x -> Printf.bprintf buff "%s\n" x) fmt in
let w fmt = Printf.ksprintf (fun x -> Printf.bprintf buff "%s" x) fmt in
header buff;
let title = sprintf "Grew -- Module %s" module_.Ast.module_id in
header ~title buff;
wnl " <div class=\"navbar\">";
w " ";
......@@ -184,7 +187,8 @@ module Html = struct
let wnl fmt = Printf.ksprintf (fun x -> Printf.bprintf buff "%s\n" x) fmt in
let w fmt = Printf.ksprintf (fun x -> Printf.bprintf buff "%s" x) fmt in
header buff;
let title = sprintf "Grew -- Rule %s/%s" mid rid in
header ~title buff;
wnl " <div class=\"navbar\">";
w " ";
......@@ -252,7 +256,8 @@ module Html = struct
let buff = Buffer.create 32 in
let wnl fmt = Printf.ksprintf (fun x -> Printf.bprintf buff "%s\n" x) fmt in
header buff;
let title = sprintf "Grew -- List of sequences" in
header ~title buff;
wnl " <div class=\"navbar\">&nbsp;<a href=\"index.html\">Up</a></div>";
wnl " <center><h1>List of sequences</h1></center>";
......@@ -276,7 +281,9 @@ module Html = struct
let buff = Buffer.create 32 in
let wnl fmt = Printf.ksprintf (fun x -> Printf.bprintf buff "%s\n" x) fmt in
header buff;
let title = sprintf "Grew -- Index of modules" in
header ~title buff;
wnl " <div class=\"navbar\">&nbsp;<a href=\"index.html\">Up</a></div>";
wnl " <center><h1>Index of modules</h1></center>";
wnl " <table width=100%%>";
......@@ -304,7 +311,9 @@ module Html = struct
let wnl fmt = Printf.ksprintf (fun x -> Printf.bprintf buff "%s\n" x) fmt in
let w fmt = Printf.ksprintf (fun x -> Printf.bprintf buff "%s" x) fmt in
header buff;
let title = sprintf "Grew -- Features domain" in
header ~title buff;
wnl " <div class=\"navbar\">&nbsp;<a href=\"index.html\">Up</a></div>";
wnl " <h6>Features</h6>";
......@@ -341,12 +350,13 @@ module Html = struct
(** index.html **)
let index = Filename.concat output_dir "index.html" in
(* let table = create_modules_table ast.Ast.modules in *)
let buff = Buffer.create 32 in
let wnl fmt = Printf.ksprintf (fun x -> Printf.bprintf buff "%s\n" x) fmt in
header buff;
let title = sprintf "Grew -- Graph Rewriting System: %s" (Filename.basename file) in
header ~title buff;
wnl " <div class=\"navbar\">&nbsp;<a href=\"../index.html\">Rewriting Stats</a></div>";
......@@ -425,5 +435,5 @@ module Html = struct
close_out page_out_ch;
done;
done;
end
end (* module Html *)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment