anchor.diff: +;;; cliki-convert.lisp
  +;;;
  +;;; WARNING!
  +;;; use "convmv -f latin1 -t utf8 --nosmart --replace --notest *"
  +;;; for prepare old cliki pages
  +
   (in-package #:cliki2)
   
  -(defun htmlize-old-cliki-page (file &aux (str (alexandria:read-file-into-string file)))
  +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  +;;;; prepare old cliki article
  +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  +
  +(defun htmlize-old-cliki-page (file &aux (str (alexandria:read-file-into-string file :external-format :latin1)))
     (with-output-to-string (out)
       (dolist (p (ppcre:split "\\n\\s*\\n" str))
         (format out "<p>~A</p>" p))))
  +
  +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  +;;;; covert old cliki article
  +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   
   (defun convert-old-cliki-page (file)
     (with-input-from-string (in (htmlize-old-cliki-page file))
  
positive.code:                             :input in
                              :output s))))
  
  (defun load-old-articles (old-article-dir &key verbose)
    "WARNING: This WILL blow away your old store."
    (let ((old-articles (make-hash-table :test 'equal))
  
negative.code:     (close-store)
      (cl-fad:delete-directory-and-files store-dir)
      (open-store store-dir)
      (dolist (file (cl-fad:list-directory old-article-dir))
        (push file (gethash (string-downcase (hunchentoot:url-decode (substitute #\% #\= (pathname-name file))
                                                                     hunchentoot::+latin-1+))
                            old-articles)))
      ;; sort revisions and discard deleted pages
      (loop for article being the hash-key of old-articles do
           (setf (gethash article old-articles)
                 (sort (gethash article old-articles) #'string< :key #'file-namestring))
           (when (search "*(delete this page)"
                         (alexandria:read-file-into-string
                          (car (last (gethash article old-articles)))
                          :external-format :latin1)
                         :test #'char-equal)
             (remhash article old-articles)))
      ;; import into store
  