File tree Expand file tree Collapse file tree 2 files changed +24
-7
lines changed Expand file tree Collapse file tree 2 files changed +24
-7
lines changed Original file line number Diff line number Diff line change 44
44
(title " Untitled" )
45
45
time
46
46
expiry-time
47
- paragraphs
47
+ body-function
48
48
score
49
49
score-update-time)
50
50
111
111
112
112
(my-defun entry story-ml ()
113
113
(<div :class " blog-entry-story"
114
- (loop for p in (my paragraphs)
115
- do (<p (output-raw-ml p)))))
114
+ (funcall (my body-function))))
116
115
117
116
(my-defun entry comments ()
118
117
(datastore-retrieve-indexed ' comment ' entry-index-name (my index-name)))
193
192
(setf (entry-channel-entry channel) me))))
194
193
195
194
(my-defun entry read-paragraphs-from-buffer (buffer)
196
- (setf (my paragraphs)
197
- (split-into-paragraphs
198
- (match-replace-all buffer
199
- (" ${static-base}" (byte-vector-cat (blog-static-base-url (my blog)) (my name)))))))
195
+ (cond ((if-match-bind ((* (space )) " (progn" ) buffer)
196
+ (setf (my body-function)
197
+ (compile (gensym (my name))
198
+ ` (lambda ()
199
+ (with-ml-output
200
+ , (let ((*package* (find-package ' #:tpd2.blog-user))) (read-from-string (force-string buffer)))
201
+ )))
202
+ ))
203
+ (t
204
+ (let ((paragraphs
205
+ (split-into-paragraphs
206
+ (match-replace-all buffer
207
+ (" ${static-base}" (byte-vector-cat (blog-static-base-url (my blog)) (my name)))))))
208
+ (setf (my body-function)
209
+ (lambda ()
210
+ (with-ml-output
211
+ (loop for p in paragraphs
212
+ do (<p (output-raw-ml p))))))))))
200
213
201
214
(defun parse-time (str)
202
215
(match-bind
Original file line number Diff line number Diff line change 430
430
(:nicknames # :tpd2.blog)
431
431
(:use # :cl # :tpd2.webapp # :tpd2.ml # :tpd2.ml.html # :tpd2.lib # :tpd2.datastore))
432
432
433
+ (defpackage #:teepeedee2.blog-user
434
+ (:nicknames # :tpd2.blog-user)
435
+ (:use # :cl # :tpd2.webapp # :tpd2.ml # :tpd2.ml.html # :tpd2.lib))
436
+
433
437
(defpackage #:teepeedee2.survey
434
438
(:nicknames # :tpd2.survey)
435
439
(:use # :cl # :tpd2.webapp # :tpd2.ml # :tpd2.ml.html # :tpd2.lib # :tpd2.datastore))
You can’t perform that action at this time.
0 commit comments