site.cd 18.3 KB
Newer Older
1
2
(* This CDuce script produces CDuce web site. *)

3
4
(** Command line **)

5
let input =
6
  match argv [] with
7
  | [ s ] -> s
8
  | _ -> raise "Please use --arg to specify an input file on the command line"
9

10
(** Output types **)
11

12
using H = "xhtml"
13

14
15
(** Input types **)

16
type Site = <site>[ <title>String Page ]
17
type Page =  <page name=Latin1 url=?String new=?"" leftbar=?("true"|"false")>[ <title>String <banner>[InlineText*]? Item* ]
18
type External = <external {|href=String; title=String; name=String |}>[]
19
20

type Item = 
21
   <box ({| title=String; link=String; short=?String |} | {| |})>Content
22
23
 | <meta>Content
 | <left>Content
24
 | <footnotes>[]
25
 | Page
26
 | External
27

28
type Author = <author presenter=?("yes"|"no")>String
29
type Paper = 
30
  <paper file=?String old=?"">[ 
31
     <title>String Author+ <comment>[InlineText*] <abstract>Content ]
32
33

type Slides = 
34
  <slides file=String>[ <title>String Author+ <comment>[InlineText*] ]
35
36

type Link =
37
  <link url=String title=String>[ InlineText* ]
38
39

type Content =      
40
   [ ( <p {|style=?String|}>[InlineText*]
41
     | <ul {||}>[<li {||}>Content *]
42
     | <ol {|style=?String|}>[<li {||}>Content *]
43
     | <section title=String>Content
44
     | <sample highlight=?"true"|"false">String
45
     | <xmlsample highlight=?"true"|"false">String
46
     | <sessionsample highlight=?"true"|"false">String
47
     | H:Xtable
48
     | Paper | Slides | Link
49
50
     | <boxes-toc short=?"" sections=?"">[]
     | <pages-toc sections=?"">[]
51
52
     | <site-toc>[]
     | <local-links href=String>[]
53
     | <two-columns>[ <left>Content <right>Content ]
54
     | <note title=?String> Content
55
     | <footnotes>[]
56
     | <xhtml>H:Flow
57
     | <demo label=?String prefix=?String>String 
58
     | InlineText
59
     )* ]
60
61
62

type InlineText =
     Char
63
   | <(`b|`i|`tt|`em) {| style=?String |}>[InlineText*]
64
   | <code>String
65
   | <local href=String>String
66
   | <footnote>[InlineText*]
67
68
69
70
71
72
   | H:Xa | H:Ximg | H:Xbr
   | <thumbnail href=String width=?IntStr height=?IntStr>[]
   | <thumbnails href=String width=?IntStr height=?IntStr>[ PCDATA ]

type IntStr = ['0'--'9'+]

73

74
75
76
77
(** Generic purpose functions **)

(* Recursive inclusion of XML files and verbatim text files *)

78
let load_include (Latin1 -> [Any*])
79
 name ->
80
(*   let _ = print [ 'Loading ' !name '... \n' ] in *)
81
   xtransform [ (load_xml name) ] with 
82
83
   | <include file=(s & Latin1)>[] -> load_include s
   | <include-verbatim file=(s & Latin1)>[] -> load_file s 
84

85
(* Highlighting text between {{...}} *)
86

87
88
89
let highlight (String -> [ (Char | H:Xstrong | H:Xi)* ] )
 | [ '{{%%' h ::(Char *?) '%%}}' ; rest ] -> 
          [ <strong class="highlight">[<i>h]; highlight rest ]
90
 | [ '{{' h ::(Char *?) '}}' ; rest ] -> 
91
          [ <strong class="highlight">h; highlight rest ]
92
93
94
95
 | [ '$$%%' h ::(Char *?) '%%$$' ; rest ] -> 
          [ <strong class="ocaml">[<i>h]; highlight rest ]
 | [ '$$' h ::(Char *?) '$$' ; rest ] -> 
          [ <strong class="ocaml">h; highlight rest ]
96
 | [ '%%' h ::(Char *?) '%%' ; rest ] ->
97
          [ <i>h; highlight rest ] 
98
 | [ c; rest ] -> [ c; highlight rest ]
99
 | [] -> []
100

101
102
(* Split a comma-separated string *)

103
let split_comma (String -> [String*])
104
 | [ x::(Char*?) ',' ; rest ] -> (x, split_comma rest)
105
 | s -> [ s ]
106

107
108
109
110
111
112
113
114
type wschar = ' ' | '\n' | '\t' | '\r'

let split_thumbnails (String -> [(String,String)*])
 | [ wschar* x::(Char\wschar\':')+ ':' y::_*? '.'; rest ] -> 
        ((x,y), split_thumbnails rest)
 | [ wschar* x::(Char\wschar)+; rest ] -> 
        ((x,""), split_thumbnails rest)
 | [ wschar* ] -> []
115

116
(** Internal types **)
117

118
type Path = [ { url = String; title = String }* ]
119
type Tree = { name = String; url = String; title = String; 
120
              children = [Tree*]; boxes = [H:Xul?] } 
121

122
123
124
let url_of_page (Page -> String)
 | <page url=u>_ -> u
 | <page name=n>_ -> n @ ".html"
125

126
127
128
129
130
131
132
let render(a : String)(p : {presenter=?"yes"|"no"}) : H:Flow =
         (match p with  {presenter="yes"} -> [<strong class="ocaml">a] | _ -> a)

let authors ([Author+] -> H:Flow)
 | [ <author (p)>a ] -> render a p
 | [ <author (p1)>a1 <author (p2)>a2 ] -> (render a1 p1) @ ", and " @ (render a2 p2)
 | [ <author (p)>a; rem ] -> (render a p)@ ", " @ authors rem
133

134
let find_local_link (sitemap : [Tree*], l : String) : Tree =
135
136
match sitemap with
 | (h,t) ->
137
   if (h . name = l) then h
138
139
140
   else 
    (try find_local_link (t,l) with `Not_found -> 
         find_local_link (h . children,l))
141
 | [] -> raise `Not_found
142

143
let local_link (sitemap : Tree, l : String, txt : String) : [H:Inline?] =
144
145
146
 try 
  let h = find_local_link ([sitemap],l)  in
  let txt = if txt = "" then h . title else txt in
147
148
149
150
  [ <a href=(h . url)>txt ]
 with `Not_found -> 
  print [ 'Warning. Local link not found: ' !(string_of l) '\n' ];
  []
151
 
152
let compute_sitemap ((Page|External) -> Tree)
153
 | <page name=name>[ <title>title (c::(Page|External) | _)* ] & p ->
154
   let children = map c with p -> compute_sitemap p in
155
   { name = name; url = (url_of_page p); title = title; 
156
     children = children; boxes = (boxes_of p) }
157
 | <external name=name href=h title=t>[] ->
158
   { name = name; url = h; title = t; children = []; boxes = [] }
159

160
161
let ul([H:Xli*] -> [H:Xul?]) [] -> [] | l -> [ <ul>l ]

162
163
164
165
166
let ol(([H:Xli*],{|style=?String|}) -> [H:Xol?]) 
      ([],_) -> [] 
    | (l,s&{|style=?String|}) -> [ <ol (s)>l ] 


167

168
let display_sitemap (h : Tree) :  H:Xli =
169
  let ch = map h . children with x -> display_sitemap x in
170
  <li>[ <a href=(h . url)>[ '[' !(h . title) ']' ] !(h . boxes); (ul ch) ]
171

172

173
let boxes_of (Page -> [H:Xul?])
174
<page>[ (items::Item | _)*] & p ->
175
 let toc = transform items with 
176
 | <box title=t link=l>_ -> [ <li>[ <a href=[ !(url_of_page p) '#' !l ]>t ] ] 
177
178
179
 in
 ul toc

180
let link_to (<page>[<title>t ; _ ] & p : Page) : H:Xa =
181
182
183
 let t = match p with
 | <_ new="">_ -> t @ [ <img src="img/new.gif" alt="(new)" style="border:0">[]]
 | _ -> t in
184
 <a href=(url_of_page p)>t
185

186
let small_box (x : H:Flow) : H:Block =
187
 <table cellpadding="2" 
188
189
    style="font-size:11px ; font-family:arial,sans-serif;
           border: solid 2px black; background: #ffffff" width="100%">
190
191
   [ <tr> [<td>x] ]

192
let meta (x : H:Flow) : H:Block =
193
 <table cellpadding="2" 
194
    style="border: solid 1px #b0b0b0; background: #e0e0e0; font-size: 80%"  
195
196
197
    width="100%">
   [ <tr> [<td>x] ]

198
let box_title (x : H:Flow, a : String, t : String) : H:Block =
199
200
 <table cellpadding="5" 
    style="border: solid 2px black; background: #ffffff" width="100%">
201
202
203
204
   [ <tr>[ 
       <td style="background: #fff0f0; color: #0000ff; font: bold 100%
                  helvetica">[<a name=a>t] ] 
     <tr> [<td>x] ]
205

206
207
208
209
210
let box (x : H:Flow) : H:Block =
 <table cellpadding="5" 
    style="border: solid 2px black; background: #ffffff" width="100%">
   [ <tr> [<td>x] ]

211
212
213
214
215
216
let style = "
a:link:hover, a:visited:hover {
  text-decoration: none;
  background: #FFFFD0;
  color: #FF0000;
}
217
218
219
220
221
222
223
224
a.old, a.old:hover, a.old:visited:hover { text-decoration: line-through; }
p { text-align: justify; margin: 1ex 1em 0 1em; }
pre { margin: 1ex 1em 0 1em; }
strong.ocaml{ color: #333b8e; }
strong.highlight { color: #FF0000; }
img.icon { border: 0; }
div.code { background: #E0E0E0; margin: 0.5ex 0.5em 0 0.5em; padding: 0.2ex; }
div.xmlcode { background:#ebefa2; margin: 0.5ex 0.5em 0 0.5em; padding: 0.2ex;}
225

226
div.abstract { 
227
  font: bold helvetica;
228
229
230
231
  margin: 1ex 1em 1ex 1em;
  padding: 1ex 1em 1ex 1em;
  background: #F0F0F0;
}
232
233

div.note { 
234
  text-align: justify;
235
236
237
238
239
240
  font: bold helvetica;
  margin: 1ex 3em 1ex 3em;
  padding: 1ex 1em 1ex 1em;
  background: #D0E2D2;
}

241
242
243
244
245
246
247
248
div.session
 { 
  font: bold 80% helvetica;
  margin: 1ex 1em 1ex 1em;
  padding: 1ex 1em 1ex 1em;
  border: solid .5px grey;
}

249
div.abstract p { font: sans-serif; }
250
251
"

252
253
type PageO = Page | []

254

255
256
257
258
259
260
261
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) 
: H:Inline =
  <input type="submit" id=id 
   style=("font-size:8px;"@style) value=title 
   onclick=onclick>[] 
262

263
264
265
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
266
 [ !(if (no = 1) then [<script src="demo.js" type="text/javascript">" "]
267
268
269
270
     else [])
  <table style="width:100%">[
   <tr>[ 
    <td style="width:50%">[
271
     (button_id (n@"btn") "Edit" ("editable('"@n@"','');") "")
272
     (button "Evaluate" ("submit('"@n@"');"))
273
     (button "Default" ("defreq('"@n@"');"))
274
     (button_id (n@"btnclear") "Clear" ("clearreq('"@n@"');") "visibility:hidden;")
275
276
    ]
    <td style="width:50%">[
277
     <input id=(n@"def") type="hidden" value=txt>[]
278
     <input id=(n@"prefix") type="hidden" value=prefix>[]
279
     (button "Clear" ("clearres('"@n@"');"))
280
281
    ] ]
   <tr>[
282
    <td valign="top">[ 
283
284
285
     <div id=(n@"container")>[
      <pre id=(n@"req")>txt
      <textarea id=(n@"edit") cols="50" rows="25" style="display:none;border:1px solid #CCCCCC; background-color:#F0F0F0;">txt 
286
287
     ]
    ]
288
289
    <td valign="top">[ <div id=(n@"res")>[] ] ] ] 
  ]
290

291
292
(* Main transformation function *)

293
(* returns the last page of the descendance *)
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308

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} -> 
   (String -> String ->H:Inlines))
  | { width = w; height = h } ->
      let w = int_of w in let h = int_of h in
      (match h with
       | 0 -> raise "Thumbnail height = 0"
       | h -> let w = string_of ((w * 200) div h) in thumbnail (w,"200"))
  | _ -> thumbnail ("266","200")

309
310
let gen_page (site : String,
              prev : PageO, page : Page, next : PageO, 
311
312
              path : Path, sitemap : Tree) : PageO = 
match page with 
313
<page name=name leftbar="false"&(leftbar:=`false) else (leftbar:=`true)>[ 
314
 <title>title <banner>banner | <title>(title & banner); items ] ->
315

316
 let footnote_counter = ref Int 0 in 
317
 let footnotes = ref H:Flow [] in
318
 let demo_no = ref Int 0 in
319
 let last_demo = ref String "" in
320

321
 let text (t : [InlineText*]) : H:Inlines =
322
323
  transform t with
   | <code>x -> [ <b>[ <tt>(highlight x) ] ]
324
   | <local href=l>txt -> local_link (sitemap,l,txt)
325
   | <(tag & (`b|`i|`tt|`em)) (attr)>x -> [ <(tag) (attr)>(text x) ]
326
327
328
329
330
   | <footnote nocount=_>_ -> 
      let n = string_of !footnote_counter in
      [ <a name=[ 'bnote' !n ]>[]
        <a href=[ '#note' !n ]>[ '[' !n ']' ] ]

331
332
333
334
335
336
337
338
339
340
341
   | <footnote>c -> 
      footnote_counter := !footnote_counter + 1;
      let n = string_of !footnote_counter in
      let fn = !footnotes in
      footnotes := [];
      let c = <p>[ <a name=[ 'note' !n ]>[] 
                   <a href=[ '#bnote' !n ]>[ '[' !n ']' ]
		   ' ' ; text c ] in
      footnotes := fn @ [ c ] @ !footnotes;
      [ <a name=[ 'bnote' !n ]>[]
        <a href=[ '#note' !n ]>[ '[' !n ']' ] ]
342
343
344
345
346
347
348
349
350
351
   | <thumbnail ({href=url} & r)>[] ->
      thumbwh r url ""
   | <thumbnails ({href=url} & r)>l ->
      let l = split_thumbnails l in
      let f = thumbwh r in
      let c = ref Int 0 in
      (transform l with (x,y) -> 
          let t = f (url @ x) y in
          if (!c = 4) then (c := 1; [ <br>[] ] @ t)
          else (c := !c + 1; t))
352
   | z -> [ z ] 
353
 in
354

355
 let content (t : Content) : H:Flow =
356
  transform t with
357
   | <section title=title>c -> 
358
         [ <p>[ <b style="color: #008000">title ] !(content c) ]
359
   | <paper (r)>[ <title>tit aut::Author* <comment>com <abstract>ab  ] ->
360
         [ (match r with
361
           | { file = f; old = "" } -> <a class="old" href=f>tit
362
363
           | { file = f } -> <a href=f>tit
           | _ -> <b>tit) '. '
364
           !(authors aut) '. '
365
	   !(text com)
366
367
368
           <div class="abstract">[ 'Abstract:' !(content ab) ]
         ]
   | <slides file=f>[ <title>tit aut::Author* <comment>com ]  ->
369
        [ <a href=f>tit '. ' !(authors aut) '. ' !(text com) ]
370
371
   | <sample highlight="false">s ->
        [ <div class="code">[ <pre>s ] ]
372
   | <sample>s ->
373
        [ <div class="code">[ <pre>(highlight s) ] ]
374
375
376
377
   | <xmlsample highlight="false">s ->
        [ <div class="xmlcode">[ <pre>s ] ]
   | <xmlsample>s ->
        [ <div class="xmlcode">[ <pre>(highlight s) ] ]
378
379
380
381
   | <sessionsample highlight="false">s ->
        [ <div class="session">[ <pre>s ] ]
   | <sessionsample>s ->
        [ <div class="session">[ <pre>(highlight s) ] ]
382
   | <link url=url title=title>com -> 
383
        [ <ul>[ <li>[ <a href=url>title '. ' !(text com) ] ] ]
384
   | <ul>lis -> 
385
        ul (map lis with <li>x -> <li>(content x))
386
387
   | <ol (attr) >lis -> 
        ol ((map lis with <li>x -> <li>(content x) ),(attr))
388
   | H:Xtable & x -> 
389
       [ <table width="100%">[<tr>[<td align="center">[x]]] ]
390
   | <p (attr)>x -> [ <p (attr)>(text x) ]
391
   | <pages-toc (a)>[] ->
392
393
394
395
396
397
      let toc = transform items with 
      | Page & p -> 
        let sects = match a with {|sections=_|} -> boxes_of p | _ -> [] in
        [ <li>[ (link_to p) ; sects ] ]
      | <external href=l title=t>[] -> [ <li>[ <a href=l>t ] ] in
      ul toc
398
   | <boxes-toc (a)>[] ->
399
400
      let sections = match a with { section=_ } -> `true | _ -> `false in
      let short = match a with { short=_ } -> `true | _ -> `false in
401
      let toc = transform items with 
402
403
404
405
      | <box ({title=t; link=l} & ({short=s} | {title=s}))>b ->
        let t = if short then s else t in
        let sects = 
         if sections then
406
          (transform b with <section title=t>_ -> [<br>[] '-' !t])
407
         else [] in
408
409
        [ <li>[ <a href=('#',l)>t !sects ]] in
      ul toc
410
411
412
   | <site-toc>[] ->
        [ <ul>[ (display_sitemap sitemap) ] ]
   | <local-links href=s>[] ->
413
414
        ul (transform (split_comma s) with x -> 
             match local_link(sitemap,x,"") with [] -> [] | x -> [<li>x])
415
416
417
418
419
   | <two-columns>[ <left>x <right>y ] ->
	[ <table width="100%">[ 
            <tr>[ 
              <td valign="top">(content x) 
              <td valign="top">(content y) ] ] ]
420
   | <note title=t>c ->  [ <div class="note">[ <b>[!t ':  '] !(content c) ]]
421
422
423
424
425
   | <note>c ->  [ <div class="note">[ <b>"Note:  " !(content c) ]]
   | <footnotes>[] -> 
       (match !footnotes with 
        | [] -> [] 
        | n -> footnotes := []; [ <br>[] (meta n) ] )
426
   | <xhtml>i -> i
427
428
429
430
431
432
433
434
435
   | <demo (r)>s -> 
       demo_no := !demo_no + 1; 
       let name = match r with { label } -> label | _ -> string_of !demo_no in
       let prefix = 
           match r with { prefix = "last" } -> !last_demo 
                      | { prefix } -> prefix
                      | _ -> "" in
       last_demo := name;
       demo !demo_no name prefix s
436
437
   | t -> text [ t ]
 in
438

439
(* Preparing left panel *)
440

441
 let left = 
442
443
444
445
  if leftbar then
  let navig = transform items with <left>c -> [ c ] in
  let left = match navig with [] -> [ [<boxes-toc>[]] ] | n -> n in
  [
446
  
447
   <td valign="top" align="left">[
448
     <span style="position:fixed;background:#ffffff;border: solid 2px black; cursor:e-resize;" onclick="javascript:var s=document.getElementById('leftbar').style; var d=s.display=='none'?'block':'none'; s.display=d; document.cookie='leftbar='+d;">"*"
449
     <table cellpadding="0" cellspacing="15" id="leftbar"
450
451
            width="200"
            style="font-size:80%; border: 1px dashed black;
452
                   background: #ffcd72">	(* altbg 9aa8ba *)
453
454
     (map left with x -> <tr>[ <td>[ (small_box (content x)) ] ]) ] ]
 else [] in
455

456
 let dpath : H:Inlines = transform path with 
457
  | { url = f; title = t } -> [ <a href=f>t ': '] 
458
 in
459
 let npath = path @ [ { url = (url_of_page page); title = title } ] in
460
 let subpages = transform items with p & Page -> [ p ] in
461
 let (next,last) = gen_page_seq (site,page, subpages, next, npath, sitemap) in
462
 let next = match next with [] -> [] 
463
464
   | <page>[ <title>t; _ ] & p -> 
      [ <a href=(url_of_page p)>[ 
465
          <img width="16" height="16" class="icon" alt="Next page:"
466
               src="img/right.gif">[]
467
468
469
          ' ' !t
        ] ] in
 let prev = match prev with [] -> [] 
470
471
   | <page>[ <title>t; _ ] & p -> 
      [ <a href=(url_of_page p)>[ 
472
          <img width="16" height="16" class="icon"
473
               alt="Previous page:" src="img/left.gif">[]
474
475
          ' ' !t
        ] ] in
476
 let navig = 
477
   if prev = [] then [] else
478
   [ (small_box [
479
     <p>[ !dpath !title ]
480
481
482
483
     <p>[ !prev ' ' !next ] ]) ] in

(* Preparing main panel *)
 let main = transform items with
484
485
   | <box title=t link=l>c -> [ (box_title (content c, l, t)) ]
   | <box>c -> [ (box (content c)) ]
486
487
488
489
   | <footnotes>[] -> 
       (match !footnotes with 
        | [] -> [] 
        | n -> footnotes := []; [ (meta n) ] )
490
   | <meta>c -> [ (meta (content c)) ]
491
 in
492
493
494
495
 let notes = match !footnotes with
   | [] -> []
   | n -> [ (meta n) ] in
 let main = match (navig @ main @ notes @ navig) with
496
497
498
   | [] -> raise "Empty page !"
   | x -> x in

499
 let right : H:Xtd =
500
501
502
503
504
505
506
507
508
509
  <td valign="top" align="left" style="width:100%">[
   <table width="100%">[
    <tr>[ <td valign="top" align="left"
              style="border: 2px solid black; background: #ffffff;
text-align:center; color: #aa0000; font: bold 200% helvetica" >
          (text banner)
        ]
 
    <tr>[
      <td valign="top" align="left"
510
          style="border: 1px solid black; background: #fccead">[ (* altbg c8ccd1 *)
511
       <table width="100%" cellpadding="0" cellspacing="17">
512
513
514
515
         (map main with x -> <tr>[ <td>[x] ])
      ] ]
  ] ] in

516
 let html : H:Xhtml =
517
518
 <html>[
  <head>[ 
519
   <title>[ !site ': ' !title ]
520
   <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">[]
521
   <style type="text/css">style
522
  ]
523
524
  <body style="margin: 0; padding : 0; background: #fcb333"
        onload="javascript:if (document.cookie.indexOf('leftbar=none')>=0) document.getElementById('leftbar').style.display='none';">[  (* altbg  4e6e99 *)
525
   <table cellspacing="10" cellpadding="0" width="100%" border="0">[
526
    <tr>[ !left right ]
527
   ]
528
  ]
529
530
 ]
 in
531
 let txt : Latin1 = 
532
   [ '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"'
533
     '  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
534
535
     !(print_xml html) ] in
 let fn = "www/" @ name @ ".html" in
536
 dump_to_file fn txt;
537
 last
538
	
539

540
let gen_page_seq 
541
542
 (site : String,
  prev : PageO, pages : [Page*], next : PageO, 
543
  path : Path, sitemap : Tree) : (PageO, PageO) =
544
545
 match pages with
 | [ p1 p2 ; _ ] & [ _; rest ] -> 
546
547
     let last = gen_page (site,prev,p1,p2, path, sitemap) in
     let (_,last)  = gen_page_seq (site,last, rest, next, path, sitemap) in 
548
     (p1,last)
549
 | [ p ] ->
550
     let last = gen_page (site,prev,p,next, path, sitemap) in (p,last)
551
 | [] -> (next,prev)
552

553

554
;;
555

556
557
558
559
560
561
562
let [<site>[ <title>site p ] ] = 
 try (load_include input :? [ Site ])
 with (err & Latin1) -> 
   print ['Invalid input document\n' !err '\n']; 
   exit 2
in
let _ = gen_page (site,[],p,[], [], compute_sitemap p) in []