Return to Snippet

Revision: 28115
at July 1, 2010 02:49 by tprimke


Initial Code
;; changes all references to the given page-old
;; to references to the given page-new
(define (change-refs page-old page-new)
  (let ( page-old-filename  (replace "_" (dup page-old 1) ".")
         rexp               (append {\[\[} page-old {\]\]})
         subst              (append {[[} page-new {]]})
         files              (slice (directory "pages/") 2) )
    (dolist (fle files)
      (let ( content  (get-content fle) )
        (if (find rexp content 0)
          (begin
            (replace rexp content subst 512)
            (write-file (append "pages/" fle) content)))))))

Initial URL


Initial Description


Initial Title
Change references to a page

Initial Tags


Initial Language
Lisp