Package docstring grovel in ABCL/DOCUMENTATION

The results of the docstring grovel are now sorted alphabetically.
parent bc866fb1
......@@ -163,3 +163,10 @@ be in a directory named '../ansi-test/'."
(defmethod perform ((o load-op) (c (eql (find-system :abcl-contrib))))
(require :abcl-contrib))
(defsystem :abcl/documentation
:depends-on (swank)
:components
((:module grovel :pathname "doc/manual/" :serial t
:components ((:file "package")
(:file "grovel")))))
(in-package :abcl/documentation)
(defun grovel-docstrings-as-tex (&optional (package (find-package :java)))
(let ((output-file (format nil "~A.tex" (string-downcase (package-name package)))))
(defun grovel-docstrings-as-tex (&key
(package (find-package :java))
(directory (asdf:component-pathname (asdf:find-component :abcl/documentation 'grovel))))
"Transform exported symbols documentation in PACKAGE to DIRECTORY."
(let ((output-file (merge-pathnames (format nil "~A.tex" (string-downcase (package-name package))) directory))
(symbols (loop :for symbol :being :each :external-symbol :of package :collecting symbol)))
(with-open-file (stream output-file :direction :output)
(format t "Writing output to ~A.~%" output-file)
(loop :for symbol :being :each :external-symbol :of package
(format t "Writing output to '~A'.~%" output-file)
(loop :for symbol :in (sort symbols (lambda (a b) (string-lessp (symbol-name a) (symbol-name b))))
:doing (format stream "~&~A~%~%" (symbol-as-tex symbol))))))
(require :asdf)
(asdf:load-system 'swank) ;; XXX Does this load the SWANK-BACKEND package as well
(defun texify-string (string &optional remove)
(with-output-to-string (s)
(loop for char across string
......@@ -29,7 +30,7 @@ Downcase symbol names but leave strings alone."
(defun arglist-as-tex (symbol)
(handler-case
(loop :for arg :in (arglist symbol)
(loop :for arg :in (ext:arglist symbol)
:collecting (texify arg))
(t (e)
(progn (warn "Failed to form arglist for ~A: ~A" symbol e)
......
(defpackage #:abcl/documentation
(:use :cl)
(:export #:grovel-docstrings-as-tex))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment