Commit 6d5a5fb7 authored by Pietro Abate's avatar Pietro Abate
Browse files

Fix site.cd to accomodate new syntax restrictions

in everything else but parametric types of the for t('a)
there must be a space between the indetifier and the parenthesis

this is valid : let hd ( ...
but this is not valid : let hd( ...
parent bffb416a
......@@ -90,7 +90,7 @@ let url_of_page (Page -> String)
| <page url=u ..>_ -> u
| <page name=n ..>_ -> n @ ".html"
let render(a : String)(p : {presenter=?"yes"|"no" ..}) : H.Flow =
let render (a : String)(p : {presenter=?"yes"|"no" ..}) : H.Flow =
match p with
| {presenter="yes" ..} -> [<strong class="ocaml">a]
| _ -> a
......@@ -126,9 +126,9 @@ let compute_sitemap ((Page|External) -> Tree)
| <external name=name href=h title>[] ->
{ name url=h title children=[] boxes=[] }
let ul([H.li*] -> [H.ul?]) [] -> [] | l -> [ <ul>l ]
let ul ([H.li*] -> [H.ul?]) [] -> [] | l -> [ <ul>l ]
let ol(([H.li*],{style=?String}) -> [H.ol?])
let ol (([H.li*],{style=?String}) -> [H.ol?])
| ([],_) -> []
| (l,s) -> [ <ol (s)>l ]
......@@ -160,15 +160,15 @@ let box (x : H.Flow) : H.Block = <div>[ !x ]
type PageO = Page | []
let button(title : String)(onclick : String) : H.Inline =
let button (title : String)(onclick : String) : H.Inline =
<input type="submit" style="font-size:8px;" value=title onclick=onclick>[]
let button_id(id : String)(title : String)(onclick : String)(style : String)
let button_id (id : String)(title : String)(onclick : String)(style : String)
: H.Inline =
<input type="submit" id=id
style=("font-size:8px;"@style) value=title
onclick=onclick>[]
let demo(no : Int)(name : String)(prefix : String)(txt : String) : H.Flow =
let demo (no : Int)(name : String)(prefix : String)(txt : String) : H.Flow =
let n = [ 'a' !name '_' ] in
let prefix = if prefix = "" then "" else [ 'a' !prefix '_' ] in
[ !(if (no = 1) then [<script src="demo.js" type="text/javascript">" "]
......@@ -203,12 +203,12 @@ let demo(no : Int)(name : String)(prefix : String)(txt : String) : H.Flow =
(* returns the last page of the descendance *)
let thumbnail(w : String, h : String)
let thumbnail (w : String, h : String)
(url : String)(title : String) : H.Inlines =
[ <a href=url>[
<img src=url width=w height=h alt="Click to enlarge" title=title>[] ] ]
let thumbwh({ width=?IntStr height=?IntStr ..} ->
let thumbwh ({ width=?IntStr height=?IntStr ..} ->
(String -> String ->H.Inlines))
| { width = w; height = h } ->
let w = int_of w in let h = int_of h in
......@@ -324,7 +324,7 @@ match page with
[ <ul>[ (display_sitemap sitemap) ] ]
| <local-links href=s>[] ->
ul (transform (split_comma s) with x ->
match local_link(sitemap,x,"") with [] -> [] | x -> [<li>x])
match local_link (sitemap,x,"") with [] -> [] | x -> [<li>x])
| <two-columns>[ <left>x <right>y ] ->
[ <table width="100%">[
<tr>[
......
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