Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
b9c0f758
Commit
b9c0f758
authored
Jul 10, 2007
by
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
web/site.cd
View file @
b9c0f758
...
...
@@ -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);;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment