Update of /project/clhp/cvsroot/public_html In directory common-lisp.net:/tmp/cvs-serv16152
Modified Files: index.clhp funcs.lisp Log Message: Got most of the functions that will be used to make thesite working
Date: Thu Nov 13 11:21:41 2003 Author: aventimiglia
Index: public_html/index.clhp diff -u public_html/index.clhp:1.4 public_html/index.clhp:1.5 --- public_html/index.clhp:1.4 Thu Nov 13 10:33:14 2003 +++ public_html/index.clhp Thu Nov 13 11:21:40 2003 @@ -15,6 +15,14 @@ (require "funcs.lisp")) (use-package :www)
+;; Page sections are all defined here each section is a list, with the +;; CAR as the section name and the CDR as the section contents. +(setq *page-sections* + '(("Introduction" + "CLHP combines the joys of common Lisp with the ease of PHP for web development") + ("Current version" + "The latest version is 0.2.0alpha"))) + ;; Start of page output (echon +doctype+)
@@ -23,12 +31,8 @@ (list (head "CLHP the Common Lisp Hypertext Preprocessor") (tag '|body| - (list - (page-header "CLHP" "the Common Lisp Hypertext Preprocessor")))))) + (page-body)))))
- - -
;(defvar *title* "CLHP the Common Lisp Hypertext Preprocessor") ;(defvar *readme* "/home/ant/src/clhp/README")
Index: public_html/funcs.lisp diff -u public_html/funcs.lisp:1.1 public_html/funcs.lisp:1.2 --- public_html/funcs.lisp:1.1 Thu Nov 13 10:33:14 2003 +++ public_html/funcs.lisp Thu Nov 13 11:21:40 2003 @@ -1,4 +1,4 @@ -;; $Id: funcs.lisp,v 1.1 2003/11/13 15:33:14 aventimiglia Exp $ +;; $Id: funcs.lisp,v 1.2 2003/11/13 16:21:40 aventimiglia Exp $ ;; ;; Functions used on clhp website ;; at http://common-lisp.net/project/clhp @@ -7,7 +7,8 @@ (defpackage :net.common-lisp.aventimiglia.clhp.www (:nicknames #:www) (:use #:cl #:clhp) - (:export #:+doctype+ #:echon #:head #:page-header)) + (:export #:+doctype+ #:echon #:head #:*page-sections* + #:page-body))
(in-package :www)
@@ -16,11 +17,16 @@ (defconstant +header-links+ '(("http://common-lisp.net/" "Common-Lisp.net")))
-(defvar *site-links* +(defconstant +site-links+ '(("http://common-lisp.net/cgi-bin/viewcvs.cgi/clhp/?cvsroot=clhp" "ViewCVS") ("ftp://common-lisp.net/pub/project/clhp/" "Downloads")))
+(defvar *page-sections* nil + "These are the text sections of the page. Each section is a element +list, where the CAR is the Section name and the CDR is the content.") + + (declaim (inline echon head))
(defun echon (&rest args) @@ -46,7 +52,31 @@ (tag '|span| '|class| "headerTitle" (list caption " ")) (tag '|span| '|class| "headerSubTitle" subtitle) (tag '|div| '|class| "headerLinks" (make-links +header-links+)) - (tag '|div| '|class| "siteMap" (make-links *site-links*))))) - + (tag '|div| '|class| "siteMap" (make-links +site-links+))))) + +(defun page-body () + (list + (page-header "CLHP" "the Common Lisp Hypertext Preprocessor") + (page-menu) + (tag '|div| '|id| "bodyText" + (loop for section in *page-sections* + nconcing (make-page-section section))))) + +(defun make-page-section (section) + (let ((name (car section))) + (cons + (tag '|h1| '|id| name name) + (loop for p in (cdr section) + collect (tag '|p| p))))) + +(defun page-menu () + (if *page-sections* + (tag '|div| '|class| "sideBox LHS" + (make-links (loop for section in *page-sections* + collect (let ((name (car section))) + (list (format nil "#~A" name) name))))) + "<!--NO PAGE MENU-->")) + +