anchor.diff:  	   (format *output-stream*
   		   "</span>"))
   	 (format *output-stream* 
  -		 "~&<span class=\"documentation-kind\">~a</span>" kind)
  +		 "~&<span class=\"documentation-kind\">~a</span>" identity)
   	 (format *output-stream* "~&</div>")
   	 (format *output-stream* 
   		 "<div class=\"documentation contents\">")	   
  
positive.code: 		thing
  		(intern (symbol-name thing) package)))
      (string (intern thing package))))
  
  (defun kind-mappings (kind)
    (case (form-keyword kind)
      (:macro '(macro function))
      (t kind)))
       
  (defextension (docs :arguments ((name) (kind)))
    (bind ((*package* (or (docs-package) *package*))
  	 (thing (ensure-symbol name *package*))
  	 (kind-or-kinds 
  	  (loop for kind in (ensure-list
  			     (or (kind-mappings (and kind (ensure-symbol kind)))
  				 '(function variable package setf
  				   type structure compiler-macro
  				   method-combination t)))
  	     when (documentation thing kind) collect
  	     kind))
  	 (kind (when (consp kind-or-kinds) (first kind-or-kinds))))
      (ecase phase 
        (:parse
         ;;?? could memoize this
         (when (consp kind-or-kinds)
  	 (when (> (length kind-or-kinds) 1)
  	   (warn "Multiple docstrings found for ~s; specify type (using ~a)" 
  		 name (first kind-or-kinds)))
  	 (setf kind-or-kinds (first kind-or-kinds)))
         (when (and (consp kind-or-kinds) (> (length kind-or-kinds) 1))
  	 (setf kind-or-kinds (first kind-or-kinds))
  	 (warn "Multiple docstrings found for ~s; specify type (using ~a)" 
  	       name kind-or-kinds))
         (unless kind-or-kinds
  	 (warn "No docstring found for ~s" name))
         (add-docs-item thing kind-or-kinds))
        (:render
         (let ((docs (documentation thing kind)))
  	 (format *output-stream* 
  		 "~&<a name=\"~a-~a\" id=\"~a-~a\"></a>" name kind name kind)
  	 (format *output-stream* 
  		 "<div class=\"documentation ~(~a~)\">" kind)
  	 (format *output-stream* 
  		 "<div class=\"documentation header\">")
  	 (format *output-stream* "<span class=\"hidden\">X</span>")
  
negative.code: 	 (format *output-stream* "~&</div>"))
         nil))))
  
  (defextension (docs-index :arguments ((kind :required)))
    (when (eq phase :render)
      (bind ((items (%items-to-index kind)))
        (cond ((empty-p items)
  	     (warn "There are no items of kind ~a documented." kind))
  	    (t
  	     (format *output-stream* 
  		     "~&<a href=\"index-~a\"></a>" kind)
  	     (format *output-stream* 
  		     "~&<div class=\"index ~(~a~)\">" kind)
  	     (format *output-stream* "~&<ul>")
  	     (loop for (item . real-kind) in items do
  		  (format *output-stream*
  			  "~&<li><a href=\"#~a-~a\">\~a</a></li>" 
  			  item real-kind item))
  	     (format *output-stream* "~&</ul></div>"))))))
  
  (defun canonize-index-kind (kind)
    (intern (string-downcase (ensure-string kind))
  	  (load-time-value (find-package :cl-markdown))))
  
  (defun %items-to-index (kind)
    (let ((docs (item-at-1 (metadata *current-document*) :docs))
  	(kind (canonize-index-kind kind)))
      (sort 
       (cond ((eq kind :all)
  	    (let ((result nil))
  	      (iterate-key-value
  	       docs
  	       (lambda (kind item-table)
  		 (setf result
  		       (nconc result 
  			      (collect-keys 
  			       item-table
  			       :transform (lambda (symbol)
  					    (cons symbol kind)))))))
  	      result))
  	   (t
  	    (collect-keys (item-at-1 docs kind) 
  			  :transform (lambda (symbol)
  				       (cons symbol kind)))))
       #'string-lessp
       :key #'first)))
  
  (defun add-docs-item (thing kind)
    (let ((kind (canonize-index-kind kind)))
      (add-docs-link thing kind)
      (bind ((docs-items
  	    (or (item-at-1 (metadata *current-document*) :docs)
  		(setf (item-at-1 (metadata *current-document*) :docs)
  		      (make-container 'simple-associative-container))))
  	   (kind-items
  	    (or (item-at-1 docs-items kind)
  		(setf (item-at-1 docs-items kind)
  		      (make-container 'simple-associative-container)))))
        (setf (item-at-1 kind-items thing) t))))
  
  (defun add-docs-link (thing kind)
    (let ((kind (canonize-index-kind kind)))
      (flet ((add-link (name title)
  	     (setf (item-at (link-info *current-document*) name)
  		   (make-instance 'link-info
  				  :id name :url (format nil "#~a" name) 
  				  :title title))))
        (bind ((kinds (symbol-identities thing)))
  	(cond ((length-1-list-p kinds)
  	       (add-link (format nil "~a" thing) 
  			 (format nil "description of ~a" thing)))
  	      (t
  	       (add-link (format nil "~a" thing) 
  			 (format nil "description of ~a" thing))
  	       (add-link (format nil "~a.~a" kind thing)
  			 (format nil "description of ~a ~a" kind thing))))))))
      
  (defun symbol-may-have-arguments-p (symbol)
    (and (fboundp symbol)
  