1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
|
# -*- tcl -*-
# site wide definitions _____________________________
# the general layout of the website. Change this to
# adjust the layout. also imposes the interfaces between
# site policy and templates
source [file join [here] formatting] ; # Make general formatting available.
# Rules for the creation of the website from the .exp files.
#
# General layout __________________________
# Header | [page_begin tag]
# - Navigation - |
# Interlude | [page_content]
# - Content - |
# Footer | [page_end]
proc sitepage {tag text url} {
global pages
if {[info exists pages(t,$tag)]} {
error "Page $tag already defined"
}
set pages(t,$tag) .
lappend pages(tags) $tag
url $tag $text $url
return
}
proc manpage {tag text url} {
global pages
if {[info exists pages(t,$tag)]} {
error "Page $tag already defined"
}
set pages(t,$tag) .
lappend pages(mp) $tag
url $tag $text $url
return
}
proc page_begin {tag} {
global pages
if {![info exists pages(t,$tag)]} {
error "Unknown page $tag"
}
set title [$tag text]
set pages(_) $tag
set data [header $title]
append data "[table][trtop]"
append data "[td]<h1>[sfproject]</h1><hr></td>[td][nbsp]</td>[td]<h1>[pagetitle]</h1></td></tr>"
append data [page_navigation_begin]
}
proc page_content {} {
global pages
unset pages(_)
page_navigation_end
}
proc page_end {} {
set last_update [readFile [file join [state] sn.time]]
set data "<tr><td colspan=3 [use_bg]><hr></td></tr>"
append data "<tr><td [use_bg] colspan=3><b>Last updated @ $last_update</b></td></tr>"
append data "<tr><td [use_bg] colspan=3>"
append data "[table][trtop][td][news]</td>[td][stats]</td></tr></table>"
append data "</td></tr>"
append data "</table></td></tr></table>[trailer]"
return $data
}
proc page_navigation_begin {} {
set data "[trtop][td][table][trtop]<td>[table][trtop]"
append data "[td]<p align=center>[sf/img]<br><br>[mem/logo/100]<br><br>[tcl/sf/img]</td>"
append data "[td][nbsp]</td>[td][sect Crossreferences]"
return $data
}
proc page_navigation_end {} {
return "</td></tr></table></td></tr></table></td>[td][nbsp]</td>[td]"
}
proc nav_link {link} {
return $link<br>
}
proc site_xref {} {
global pages
set data ""
foreach tag $pages(tags) {
if {0 == [string compare $tag $pages(_)]} {
append data [nav_link "<font color=[hlcolor]><b>[$tag text]</b></font>"]
} else {
append data [nav_link [$tag]]
}
}
return $data
}
proc mp_xref {} {
global pages
set data "<hr>[sect Manpages]"
foreach tag $pages(mp) {
if {0 == [string compare $tag $pages(_)]} {
append data [nav_link "<font color=[hlcolor]><b>[$tag text]</b></font>"]
} else {
append data [nav_link [$tag]]
}
}
return $data
}
|