Commit b9c0f758 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2003-05-14 20:42:52 by cvscast] Empty log message

Original author: cvscast
Date: 2003-05-14 20:48:18+00:00
parent 5ff91324
......@@ -114,6 +114,10 @@ type Path = [ { url = String; title = String }* ];;
type Tree = { name = String; url = String; title = String;
children = [Tree*] } ;;
let fun url_of_name (String -> String)
"index" -> "/"
| s -> s @ ".html";;
let fun authors ([Author+] -> String)
| [ <author>a ] -> a
| [ <author>a1 <author>a2 ] -> a1 @ ", and " @ a2
......@@ -135,7 +139,7 @@ let fun local_link (sitemap : Tree, l : String) : Inline =
let fun compute_sitemap ((Page|External) -> Tree)
<page name=name>[ <title>title (c::(Page|External) | _)* ] ->
let children = map c with p -> compute_sitemap p in
{ name = name; url = name; title = title; children =children }
{ name = name; url = url_of_name name; title = title; children =children }
|<external name=name; href=h; title=t>[] ->
{ name = name; url = h; title = t; children = [] };;
......@@ -184,7 +188,7 @@ match page with
| <pages-toc>[] ->
let toc =
transform items with
<page name=l>[<title>t;_]
| <page name=l>[<title>t;_] -> [ <li>[ <a href=(url_of_name l)>t ] ]
| <external href=l; title=t>[] -> [ <li>[ <a href=l>t ] ] in
(match toc with [] -> [] | lis -> [ <ul>lis ])
| <boxes-toc>[] ->
......@@ -236,8 +240,9 @@ match page with
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"'
' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
!(patch_css (print_xml html)) ] in
let [] = dump_to_file (name @ ".php") txt in
let path = path @ [ { url = name; title = title } ] in
let [] = dump_to_file (name @ ".html.php") txt in
let url = url_of_name name in
let path = path @ [ { url = url; title = title } ] in
transform items with p & Page -> gen_page (p,path,sitemap);;
......
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