aboutsummaryrefslogtreecommitdiff
path: root/module/output
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2020-01-22 10:35:13 +0100
committerHugo Hörnquist <hugo@hornquist.se>2020-01-22 10:35:13 +0100
commit1bed79f98e16ee2c3810f27d74b768d3da71626b (patch)
tree2dbab5c43185ac61e99fcb19fe50908c273fcbfd /module/output
parentExperiments with multithreading. (diff)
downloadcalp-1bed79f98e16ee2c3810f27d74b768d3da71626b.tar.gz
calp-1bed79f98e16ee2c3810f27d74b768d3da71626b.tar.xz
Allow user supplied description filters.
Diffstat (limited to 'module/output')
-rw-r--r--module/output/html.scm15
1 files changed, 1 insertions, 14 deletions
diff --git a/module/output/html.scm b/module/output/html.scm
index 394bb476..16520f0b 100644
--- a/module/output/html.scm
+++ b/module/output/html.scm
@@ -12,7 +12,6 @@
#:use-module (srfi srfi-19 util)
#:use-module (output general)
- #:use-module (ice-9 regex)
#:use-module (git)
#:use-module (parameters)
@@ -24,8 +23,6 @@
(cdr p)))
param)) ,d)))
-(define (a link) `(a (@ (href ,link)) ,link))
-
(define (date-link date)
(date->string date "~Y-~m-~d"))
@@ -164,16 +161,6 @@
(end (time->string (attr ev 'DTEND) fmt)))
(values start end)))
-(define (description-preprocess text)
- (define regexp (make-regexp "https?://\\S+"))
-
- (let recur ((str text))
- (let ((m (regexp-exec regexp str)))
- (if (not m)
- '()
- (cons* (match:prefix m)
- (a (match:substring m))
- (recur (match:suffix m)))))))
;; For sidebar, just text
(define (fmt-single-event ev)
@@ -188,7 +175,7 @@
`(div ,start " — " ,end))
,(when (and=> (attr ev 'LOCATION) (negate string-null?))
`(div (b "Plats: ") ,(attr ev 'LOCATION)))
- ,(and=> (attr ev 'DESCRIPTION) description-preprocess))))
+ ,(and=> (attr ev 'DESCRIPTION) (lambda (str) ((description-filter) ev str))))))
;; Single event in side bar (text objects)
(define (fmt-day day)