aboutsummaryrefslogtreecommitdiff
path: root/org/blog/generate-phlog.scm
blob: 17f0778fdea4f3513fd6ae2c9d22e1031ef304e7 (plain)
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
#! /usr/bin/guile \
-e main -s
!#

(use-modules (sxml simple))

(define (make-gophermap articles)
  (call-with-output-file "phlog/gophermap"
    (lambda (fp)
      (for-each
       (lambda (article)
         (if (list? article)
             (display article)))
       (cdr (cadr articles))))))

(define (make-blogs articles)
  '())

(define (generate-phlog)
  (call-with-input-file "articles.xml"
    (lambda (fp)
      (let ((articles (xml->sxml fp)))
        (make-gophermap articles)
        (make-blogs articles)))))

(define (main args)
  (generate-phlog))