Add and export DELETE-DOCUMENT.

This commit is contained in:
Brit Butler 2014-06-03 16:32:43 -04:00
parent 62c940bde9
commit 3467157805
2 changed files with 8 additions and 3 deletions

View file

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

View file

@ -25,11 +25,12 @@
#:get-updated-files #:get-updated-files
#:theme-fn #:theme-fn
;; The Document Protocol ;; The Document Protocol
#:add-document
#:find-all
#:purge-all
#:discover #:discover
#:publish #:publish
#:page-url #:page-url
#:render #:render
#:find-all
#:purge-all
#:add-document
#:delete-document
#:write-document)) #:write-document))