/[svn]/website/trunk/web/site.cd
ViewVC logotype

Diff of /website/trunk/web/site.cd

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 253 by abate, Tue Jul 10 17:19:32 2007 UTC revision 254 by abate, Tue Jul 10 17:19:36 2007 UTC
# Line 35  Line 35 
35  type InlineText =  type InlineText =
36       Char       Char
37     | <(`b|`i) {||}>[InlineText*]     | <(`b|`i) {||}>[InlineText*]
38       | <duce>[InlineText*]
39     | Xa     | Xa
40     | Ximg     | Ximg | Xbr
41     ;;     ;;
42    
43  type Box = <box title=String; subtitle=?String; link=String>Content  type Box = <box title=String; subtitle=?String; link=String>Content
# Line 48  Line 49 
49     | [ <author>a1 <author>a2 ] -> a1 @ ", and " @ a2     | [ <author>a1 <author>a2 ] -> a1 @ ", and " @ a2
50     | [ <author>a; rem ] -> a @ ", " @ authors rem;;     | [ <author>a; rem ] -> a @ ", " @ authors rem;;
51    
52    let fun text (t : [InlineText*]) : Inlines =
53     map t with
54       <duce>x -> <b>[ <tt>(text x) ]
55     | <b>x -> <b>(text x)
56     | <i>x -> <i>(text x)
57     | z -> z;;
58    
59  let fun content (t : Content) : Flow =  let fun content (t : Content) : Flow =
60    transform t with    transform t with
61     | <section title=title>c -> [ <h4>title !(content c) ]     | <section title=title>c -> [ <h4>title !(content c) ]
# Line 58  Line 66 
66               | _ -> <b>tit               | _ -> <b>tit
67             ) '. '             ) '. '
68             !(authors aut) '. '             !(authors aut) '. '
69             !com             !(text com)
70             <div class="abstract">[ 'Abstract:' !(content ab) ]             <div class="abstract">[ 'Abstract:' !(content ab) ]
71           ]           ]
72     | <slides file=f>[ <title>tit aut::Author* <comment>com ]  ->     | <slides file=f>[ <title>tit aut::Author* <comment>com ]  ->
73          [ <a href=f>tit '. ' !(authors aut) '. ' !com ]          [ <a href=f>tit '. ' !(authors aut) '. ' !(text com) ]
74     | <link url=url; title=title>com ->     | <link url=url; title=title>com ->
75          [ <a href=url>title '. ' !com ]          [ <a href=url>title '. ' !(text com) ]
76     | <ul>lis -> [ <ul>(map lis with <li>x -> <li>(content x)) ]     | <ul>lis -> [ <ul>(map lis with <li>x -> <li>(content x)) ]
77     | x -> [  x ];;     | <p>x -> [ <p>(text x) ]
78       | <ul>x -> [ <ul>(text x) ]
79       | x -> text [ x ];;
80    
81  let fun main2html (Box -> Flow)  let fun main2html (Box -> Flow)
82    <box (r)>c ->    <box (r)>c ->
# Line 94  Line 104 
104     <link rel="stylesheet"; href="cduce.css"; type="text/css"> []     <link rel="stylesheet"; href="cduce.css"; type="text/css"> []
105    ]    ]
106    <body>[    <body>[
107     <div class="title">[ <h1>banner ]     <div class="title">[ <h1>(text banner) ]
108     <div id="Sidelog">navig     <div id="Sidelog">navig
109     <div id="Content">(transform main with b -> main2html b)     <div id="Content">(transform main with b -> main2html b)
110    ]    ]
# Line 105  Line 115 
115      let _ = print [ 'Loading ' !inf '... ' ] in      let _ = print [ 'Loading ' !inf '... ' ] in
116      let page = match load_xml inf with      let page = match load_xml inf with
117        | Page & p -> p        | Page & p -> p
118        | _ -> raise ("Invalid input document" @ inf) in        | _ -> raise ("Invalid input document: " @ inf) in
119      let _ = print [ 'Generating html ... ' ] in      let _ = print [ 'Generating html ... ' ] in
120      let html : String =      let html : String =
121         [ '<?xml version="1.0" encoding="iso-8859-1"?>'         [ '<?xml version="1.0" encoding="iso-8859-1"?>'

Legend:
Removed from v.253  
changed lines
  Added in v.254

CVS Admin">CVS Admin
ViewVC Help
Powered by ViewVC 1.1.5