qbook

ASDF Integration 

The publish-op generates documentation from the ASDF system definition. The op creates a qbook html file next to the .asd file. The default values for the parameters passed to PUBLISH-QBOOK (input-file, output-file and title) are all taken from the ASDF system. Customizing the defaults is a simple matter of passing the proper keywords to asdf:oos.

(defclass publish-op (asdf:operation)
  ((title :initarg :title
	  :documentation "The title passed to PUBLISH-QBOOK. This[...]
	  defaults to the name af the asdf system.")
   (input-file :initarg :intput-file
	       :documentation "The input-file passed to
	       PUBLISH-QBOOK. This defaults to the .asd file
	       which defines the system.")
   (output-directory :initarg :output-directory
		     :documentation "The output-directory passed
	   	     to PUBLISH-QBOOK. This defaults to a file
	   	     with the same name and directory as the asd
	   	     file but with the extension html.")))
(defmethod asdf::traverse :before ((op publish-op) (system asdf:system))
  (with-slots (input-file output-directory title)
      op[...]
    (unless (slot-boundp op 'input-file)
      (setf input-file (asdf:system-definition-pathname system)))
    (unless (slot-boundp op 'output-directory)
      (setf output-directory
	    (merge-pathnames (make-pathname :name nil :type nil)
			     (asdf:component-pathname system))))
    (unless (slot-boundp op 'title)
      (setf title (asdf:component-name system)))))
(defmethod asdf:perform ((op publish-op) (system asdf:system))
  (with-slots (input-file output-directory title)
      op
    (publish-qbook input-file :title title :output-directory output-directory)))
(defmethod asdf:perform ((op publish-op) (component t))
  t)
(defmethod asdf:operation-done-p ((op publish-op) (component t))
  nil)