;; guile -l index.scm -c '(make-html)' (define page `(page (h3 (@ (class "centered")) "A conversational introduction to arch") (conversation (a "Arch archives have names. My archive's name is " (code "wingo@pobox.com--2004-main") ". Say hi to " (code "wingo@pobox.com--2004-main") "!") (b "Hi, " (code "wingo@pobox.com--2004-main") "...") (c "Hi, nice to meet you.") (a "Arch archives are associated with places. For example, I host a public copy of my archive " (link "http://ambient.2y.net/wingo/arch/wingo@pobox.com--2004-main/" "here")) (c "I'm naked.") (b "Indecent!") (a "Not really, I'm the only one with write access.") (c "I'm yours.") (b "This is weird...") (a "Anyway, the first step to accessing an archive is to register it.") (c (code "tla register-archive wingo@pobox.com--2004-main http://ambient.2y.net/wingo/arch/wingo@pobox.com--2004-main/")) (a "Then within an archive, there are categories of software to get. What categories do you have, archive?") (c "Why don't you ask nicely?") (b "\"Ask nicely\"? A cranky archive...") (a "Oh no, it just needs to be talked to in the right way. You can browse the archive with " (code "tla abrowse wingo@pobox.com--2004-main") ".") (c "I like that.") (a "Then if you want a particular category, like guile-lib--wingo, use " (code "get") ".") (b "Ah, I read about that in the " (link "http://www.gnu.org/software/gnu-arch/tutorial/arch.html" "tutorial") ". " (code "tla get wingo@pobox.com--2004-main/guile-lib--wingo " (var "dest-dir")) ", no?") (c "I like that too.") (b "Um, ok thanks I'm going. You people, er, you, anyway you're weird.")))) ;; Now output the HTML (use-modules (sxml simple) (sxml transform)) (load "../../template.scm") (define xhtml-doctype (string-append "\n")) (define (preprocess page) (pre-post-order page `((page . ,(lambda (tag . body) body)) (conversation ((a . ,(lambda (tag . args) `(tr (td (@ (style "text-align: right;")) "Me:") (td ,@args)))) (b . ,(lambda (tag . args) `(tr (td (@ (style "text-align: right;")) "You:") (td ,@args)))) (c . ,(lambda (tag . args) `(tr (td (@ (style "text-align: right;")) "Archive:") (td ,@args))))) . ,(lambda (tag . body) `(table ,@body))) (link . ,(lambda (tag href name) `(a (@ (href ,href)) ,name))) (*text* . ,(lambda (tag text) text)) (*default* . ,(lambda args args))))) (define (make-index) (display xhtml-doctype) (sxml->xml (templatize (preprocess page) "arch on ambient" "software" "../../")))