Kaynağa Gözat

Add and export DELETE-DOCUMENT.

Brit Butler 11 yıl önce
ebeveyn
işleme
3467157805
2 değiştirilmiş dosya ile 8 ekleme ve 3 silme
  1. 4 0
      src/documents.lisp
  2. 4 3
      src/packages.lisp

+ 4 - 0
src/documents.lisp

@@ -51,6 +51,10 @@
51 51
         (error "There is already an existing document with the url ~a" url)
52 52
         (setf (gethash url *site*) document))))
53 53
 
54
+(defun delete-document (document)
55
+  "Given a DOCUMENT, delete it from the in-memory database."
56
+  (remhash (page-url document) *site*))
57
+
54 58
 (defun write-document (document &optional theme-fn &rest render-args)
55 59
   "Write the given DOCUMENT to disk as HTML. If THEME-FN is present,
56 60
 use it as the template passing any RENDER-ARGS."

+ 4 - 3
src/packages.lisp

@@ -25,11 +25,12 @@
25 25
            #:get-updated-files
26 26
            #:theme-fn
27 27
            ;; The Document Protocol
28
-           #:add-document
29
-           #:find-all
30
-           #:purge-all
31 28
            #:discover
32 29
            #:publish
33 30
            #:page-url
34 31
            #:render
32
+           #:find-all
33
+           #:purge-all
34
+           #:add-document
35
+           #:delete-document
35 36
            #:write-document))