anchor.diff:  because this name is conflicting with 'index.html'. Besides, *index-name* is also renamed to 'index.html'.
   This can be safely done, becase 'Index.html' is renamed to another name beforehand and no conflics are occured. "
     (flet ((replace-link-to-index (src)
  -           (regex-replace-all "([/\"])Index\\.html" src "\\1Indecies.html")))
  +           (cl-ppcre:regex-replace-all "([/\"])Index\\.html" src "\\1Indecies.html")))
       (format t "Making a directory ~a~%" *dst-path*)
       (ensure-directories-exist *dst-path*)
       (format t "Copying files from ~a to ~a~%" *src-path* *dst-path*)
  -    (dolist (i (list-directory *src-path*))
  -      (let ((out-path (cond ((scan "/Index\\.html$" (namestring i))
  -                             (merge-pathnames-as-file *dst-path* "Indecies.html"))
  -                            ((scan (format nil "~a$" *index-name*) (namestring i))
  -                             (merge-pathnames-as-file *dst-path* "index.html"))
  +    (dolist (i (uiop:directory-files *src-path*))
  +      (let ((out-path (cond ((cl-ppcre:scan "/Index\\.html$" (namestring i))
  +                             (merge-pathnames "Indecies.html" *dst-path*))
  +                            ((cl-ppcre:scan (format nil "~a$" *index-name*) (namestring i))
  +                             (merge-pathnames "index.html" *dst-path*))
                               (t
  -                             (merge-pathnames-as-file *dst-path* (file-namestring i)))))
  +                             (merge-pathnames (file-namestring i) *dst-path*))))
               (src (replace-link-to-index (read-file-into-string i))))
  -        (write-string-into-file src out-path :if-exists :supersede)))))
  +        (alexandria:write-string-into-file src out-path :if-exists :supersede)))))
   
   (defun flatten-sections-on-chapters ()
     "Flatten sections which has an <A> tag on each chapter document."
  -  (let* ((in-path (merge-pathnames-as-file *dst-path* "index.html"))
  +  (let* ((in-path (merge-pathnames "index.html" *dst-path*))
            (index (read-file-into-string in-path)))
       (multiple-value-bind (begin end)
           (scan-menu-list index)
  
positive.code: ;; Script for formatting draft proposed American National Standard (dpANS) on Common Lisp
  ;; so that each section has its own contents in place
  ;;
  ;; Usage: sbcl dpans-formatter.lisp DPANS_INDEX_HTML
  ;;
  ;;        DPANS_DIRECTORY is a top directory of Dpans.
  ;;
  
negative.code: 
  (defun body-content (src)
    "Return the contents of <body> in src"
    (cl-ppcre:register-groups-bind (content)
        ("(?s)<div class=\"node\">.*?</div>(.*)</body>" src)
      content))
  
  (defun scan-menu-list (src)
    "Search a <ul> tag which is a menu list except for a dictionary list."
    (multiple-value-bind (begin end)
        (cl-ppcre:scan "(?s)<ul class=\"menu\">.*?</ul>" src)
      (let ((dict (cl-ppcre:scan "(?m)^<p>Dictionary$" src)))
        (if (or (null dict)
                (and dict (< begin dict)))
            (values begin end)))))
  
  (defun replace-menu (in-path)
    "Read file into string and return the string whose menu lists are replaced with its contents recursively."
    (let ((src (alexandria:read-file-into-string in-path)))
      (multiple-value-bind (begin end)
          (scan-menu-list src)
        (if (and begin end)
            (let* ((menu (subseq src begin end))
                   (head (subseq src 0 begin))
                   (tail (subseq src end (length src)))
                   (link-paths (mapcar #'(lambda (p) (merge-pathnames p *src-path*))
                                       (iterate-on "<li>" #'scan-href menu))))
              (format nil "~a~%~{~a~%~}~a~%"
                      head
                      (mapcar #'(lambda (path)
                                  (format nil "<hr>~%<!-- ~a -->~%~a"
                                          (namestring path)
                                          (body-content (replace-menu path))))
                              link-paths)
  