; html.ss
; Copyright 2008 Christopher Michael Rasch
;
; This file is part of Wishforge.
; Wishforge is free software: you can redistribute it and/or modify
; it under the terms of the GNU Affero General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
; Wishforge is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU Affero General Public License for more details.
; You should have received a copy of the GNU Affero General Public License
; along with Wishforge. If not, see .
(module html mzscheme
(require (lib "xml.ss" "xml"))
(require (lib "date.ss"))
(provide (all-defined))
(define nl (string #\newline))
(define css-defs
(make-comment
(string-append
"BODY,B,TD"
"{font-family:Verdana,Helvetica,sans-serif;font-size:large}" nl
"B.EMPH"
"{color:blue}" nl
"H1"
"{font-family:Verdana,Helvetica,sans-serif;font-size:xx-large}" nl
"H1.EMPH"
"{color:blue;font-weight:bold}"
"H2"
"{font-family:Verdana,Helvetica,sans-serif;font-size:x-large}" nl
"H2.EMPH"
"{color:blue;font-weight:bold}"
"TD.EMPH"
"{color:black}" nl
"TD.HEADER"
"{color:white}" nl
"UL"
"{font-size:large}" nl
"UL.EMPH"
"{color:blue}" nl
"TT"
"{font-size:12px}")))
(define apply-html-template
(lambda (head-items contents)
`(HTML
(HEAD
(STYLE ((TYPE "text/css")) ,css-defs)
,@head-items)
(BODY ((BGCOLOR "white"))
(HR)
(TABLE ((BORDER "0")
(STYLE "font-size:12px; text-decoration:none")
(CELLPADDING "4")
(CELLSPACING "1")
(WIDTH "100%")
(BGCOLOR "black")
(FGCOLOR "white"))
; ,header
)
(HR)
,@contents
(HR)
,footer
))))
(define author-name "Design by Stecksoft")
(define footer
`(DIV
(TABLE ((WIDTH "100%")
(CELLSPACING "0")
(CELLPADDING "0"))
(TR
(TD ((ALIGN "left"))
(TABLE ((CELLSPACING "0")
(CELLPADDING "0"))
(TR
(TD ((CLASS "EMPH"))
(I ,author-name))))
(TD ((ALIGN "right"))
(TABLE
(TR ((ALIGN "center"))
(TD ((CLASS "EMPH"))
"powered by"))
(TR ((ALIGN "center"))
(TD (A ((HREF "http://www.plt-scheme.org/")) "PLT")
'nbsp
(A
((HREF "http://www.plt-scheme.org/"))
(IMG
((ALT "PLT Logo")
(ALIGN "center")
(BORDER "0")
(SRC "/local-icons/plt-logo.gif")))))))))))))
)