Commit 14198e2e authored by François Bobot's avatar François Bobot

[Style] Initial stylesheet

parent 735cb8da
open Html5.M
open Menu
let page ~title:t b =
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"]
[internal_link ~a:[a_style "font-size: large;"] main "SOPRANO";
pcdata (": "^p.long_title)] in
let menu =
(List.map (fun p -> internal_link p p.menu_title)) menu
in
let menu = div ~a:[a_id "Menu"] menu in
let content = div ~a:[a_id "Content"] b in
let html =
html
(head (title (pcdata t)) [meta ~a:[a_charset "utf-8"] ()])
(body b) in
(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
Html5.P.print ~output:print_string html
open Html5.M
open Generate
open Menu
let () = Generate.page ~title:"Toto" [
let () = Generate.page main [
p [pcdata "C'est ça!"]
]
open Html5.M
type page = {
long_title: string;
menu_title: string;
filename: string; (** If this field is foo the page must
be defined in "foo.page.ml" *)
}
let main = { long_title="Home"; menu_title = "Home"; filename = "index" }
let menu = [
main;
]
Menu
Generate
\ No newline at end of file
/* From bluerobot layout1 */
body {
margin:0px;
padding:0px;
font-family:verdana, arial, helvetica, sans-serif;
color:#333;
background-color:white;
}
h1 {
margin:0px 0px 15px 0px;
padding:0px;
font-size:28px;
line-height:28px;
font-weight:900;
color:#ccc;
}
p {
font:11px/20px verdana, arial, helvetica, sans-serif;
margin:0px 0px 16px 0px;
padding:0px;
}
#Content>p {margin:0px;}
#Content>p+p {text-indent:30px;}
a {
color:#09c;
font-size:11px;
text-decoration:none;
font-weight:600;
font-family:verdana, arial, helvetica, sans-serif;
}
a:link {color:#09c;}
a:visited {color:#07a;}
a:hover {background-color:#eee;}
#Header {
margin:50px 0px 10px 0px;
padding:17px 0px 0px 20px;
/* For IE5/Win's benefit height = [correct height] + [top padding] + [top and bottom border widths] */
height:33px; /* 14px + 17px + 2px = 33px */
border-style:solid;
border-color:black;
border-width:1px 0px; /* top and bottom borders: 1px; left and right borders: 0px */
line-height:11px;
background-color:#eee;
/* Here is the ugly brilliant hack that protects IE5/Win from its own stupidity.
Thanks to Tantek Celik for the hack and to Eric Costello for publicizing it.
IE5/Win incorrectly parses the "\"}"" value, prematurely closing the style
declaration. The incorrect IE5/Win value is above, while the correct value is
below. See http://glish.com/css/hacks.asp for details. */
voice-family: "\"}\"";
voice-family:inherit;
height:14px; /* the correct height */
}
/* I've heard this called the "be nice to Opera 5" rule. Basically, it feeds correct
length values to user agents that exhibit the parsing error exploited above yet get
the CSS box model right and understand the CSS2 parent-child selector. ALWAYS include
a "be nice to Opera 5" rule every time you use the Tantek Celik hack (above). */
body>#Header {height:14px;}
#Content {
margin:0px 50px 50px 200px;
padding:10px;
}
#Menu {
position:absolute;
top:100px;
left:20px;
width:172px;
padding:10px;
background-color:#eee;
border:1px dashed #999;
line-height:17px;
/* Again, the ugly brilliant hack. */
voice-family: "\"}\"";
voice-family:inherit;
width:150px;
}
/* Again, "be nice to Opera 5". */
body>#Menu {width:150px;}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Toto</title><meta charset="utf-8" /></head><body><p>C'est ça!</p></body></html>
\ No newline at end of file
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>SOPRANO: Home</title><meta charset="utf-8" /><link rel="stylesheet" href="css/main.css" /></head><body><div id="Header"><a href="index.html" title="Home" style="font-size: large;">SOPRANO</a>: Home</div><div id="Content"><p>C'est ça!</p></div><div id="Menu"><a href="index.html" title="Home">Home</a></div></body></html>
\ No newline at end of file
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