summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2015-04-11 22:32:49 -0400
committerDavid Thompson <dthompson2@worcester.edu>2015-04-11 22:33:55 -0400
commit5f7a963c17cb465a611c2a58036f8ae894f1c069 (patch)
tree1b86418bbea3270114327a8e0d32305aa5c4e7df
parent84c65348ea5542f3e2d7700e5ecc5816b9340019 (diff)
reader: Export html-reader and fix style.
* haunt/reader.scm (html-reader): Export. Use alist-cons to neaten up code.
-rw-r--r--haunt/reader.scm8
1 files changed, 4 insertions, 4 deletions
diff --git a/haunt/reader.scm b/haunt/reader.scm
index e1ab044..7610482 100644
--- a/haunt/reader.scm
+++ b/haunt/reader.scm
@@ -42,7 +42,8 @@
read-posts
make-file-extension-matcher
- sxml-reader))
+ sxml-reader
+ html-reader))
(define-record-type <reader>
(make-reader matcher proc)
@@ -109,9 +110,8 @@ list must contain a matching reader for every post."
(values metadata `(raw ,(read-string port))))
(else
(match (map string-trim-both (string-split-at line #\:))
- ((key value)
- (loop (cons (cons (string->symbol key) value)
- metadata)))
+ (((= string->symbol key) value)
+ (loop (alist-cons key (parse-metadata key value) metadata)))
(_ (error "invalid metadata format: " line))))))))
(define html-reader