;; simple weblog ;; - maintain collection of articles ;; - generate webpage from articles ;; - add/edit articles (spawn emacs), with dating, writer, talkback forum ;; entry collection (define dbfile "weblog.entries") (define db ;; ((sys-time "text") ...) '((1067613607 "first article title\nfirst article text") (1067613648 "second article title\nsecond article text"))) ;;(define (read-entries) ) ;;(define (write-entries) ) ;;(define (add-entry) ) ;; HTML generation (define output-file "weblog.html") (define html-static '((page-head " hipslog

.:hipslog:.

") (page-tail "
That's all folks.\n\n") (entry-head "\n

.: ") (entry-tail "
::"))) (define (html-get tag) (cadr (assoc tag html-static))) (define (generate-html) ;; write to weblog.html (print "generating html") (with-output-to-file output-file (lambda () (print (html-get 'page-head)) (map (lambda (entry) ; todo sort items on date/time (print (html-get 'entry-head)) (print (cadr entry)) (print "

Posted on yyyymmdd by foo. Reactions.") (print (html-get 'entry-tail))) ;;(print #`",entry-head [date] ,(cadr entry) ,entry-tail")) ;;(format #t "~a" eantry-head) ;;(sys-strftime \"%Y/%m/%d\" (sys-localtime (sys-time))) ;;(format #t "~a" (cadr entry)) ;;(format #t "~a" entry-tail)) db) ;;(print (sys-strftime "%Y/%m/%d" (sys-localtime (sys-time)))) (print (html-get 'page-tail))))) ;; main interface ;; accept commandline params: ;; "add" add an entry ;; "generate" generate page