/ Published in: Lisp
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
;; 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)))))))