anchor.diff:                             (lambda (chunk)
                                (incf index) 
                                (setf header-level
  -                                   (header-p chunk :depth depth)))))))
  +                                   (header-p chunk :depth depth :start start)))))))
       (iterate-elements 
        header-indexes
        (lambda (datum)
  
positive.code: 
  ;;; ---------------------------------------------------------------------------
  
  (defun add-anchors (document &key depth)
    (let* ((index -1)
           (header-level nil)
           (header-indexes (nreverse
  
negative.code: 
  ;; needs to add names and links too
  (defun table-of-contents (phase &rest args)
    (bind ((args (mapcar (lambda (x) (ignore-errors (read-from-string x))) args))
           (depth (ignore-errors (parse-integer (getf args :depth))))
           (start (ignore-errors (parse-integer (getf args :start-at)))))
      (ecase phase 
        (:parse
         (push (lambda (document)
                 (add-anchors document :depth depth :start start))
               (item-at-1 (properties *current-document*) :cleanup-functions))
         nil) 
        (:render
  