reader: Export html-reader and fix style.
* haunt/reader.scm (html-reader): Export. Use alist-cons to neaten up code.
This commit is contained in:
parent
84c65348ea
commit
5f7a963c17
|
@ -42,7 +42,8 @@
|
||||||
read-posts
|
read-posts
|
||||||
|
|
||||||
make-file-extension-matcher
|
make-file-extension-matcher
|
||||||
sxml-reader))
|
sxml-reader
|
||||||
|
html-reader))
|
||||||
|
|
||||||
(define-record-type <reader>
|
(define-record-type <reader>
|
||||||
(make-reader matcher proc)
|
(make-reader matcher proc)
|
||||||
|
@ -109,9 +110,8 @@ list must contain a matching reader for every post."
|
||||||
(values metadata `(raw ,(read-string port))))
|
(values metadata `(raw ,(read-string port))))
|
||||||
(else
|
(else
|
||||||
(match (map string-trim-both (string-split-at line #\:))
|
(match (map string-trim-both (string-split-at line #\:))
|
||||||
((key value)
|
(((= string->symbol key) value)
|
||||||
(loop (cons (cons (string->symbol key) value)
|
(loop (alist-cons key (parse-metadata key value) metadata)))
|
||||||
metadata)))
|
|
||||||
(_ (error "invalid metadata format: " line))))))))
|
(_ (error "invalid metadata format: " line))))))))
|
||||||
|
|
||||||
(define html-reader
|
(define html-reader
|
||||||
|
|
Loading…
Reference in New Issue