doc: fixes for grovelling docstrings

Document how to grovel docstrings in <file:doc/manual/>.

Escape #\_ characters.

Don't emit documentation for a symbol without definitions.
parent 271b90f0
......@@ -6,3 +6,25 @@ cannot run make, the following sequence of commands also gets you a pdf
of the manual:
cmd$ pdflatex abcl.tex && bibtex abcl && makeindex abcl && pdflatex abcl.tex && pdflatex abcl.tex
## Generating docstrings
1. Ensure that the toplevel 'abcl.asd' is loadable by ASDF.
If the ABCL source resides in "~/work/abcl/", this can be
accomplished by creating the file
<file:~/.config/common-lisp/source-registry.conf.d/abcl.conf> with
the contents:
(:tree (:home "work/abcl/"))
2. Execute the following code from the ABCL REPL:
(require :abcl-contrib)
(require :jss)
(asdf:load-system :abcl/documentation)
(loop :for package
:in '(:java :ext :sys :jss :mop :threads)
:doing (abcl/documentation:grovel-docstrings-as-tex :package package))
......@@ -9,12 +9,14 @@
(with-open-file (stream output-file :direction :output)
(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))))))
:doing (let ((documentation (symbol-as-tex symbol)))
(when documentation
(format stream "~&~A~%~%" documentation)))))))
(defun texify-string (string &optional remove)
(with-output-to-string (s)
(loop for char across string
do (if (find char '(#\& #\% #\#))
do (if (find char '(#\& #\% #\# #\_))
(unless remove
(write-char #\\ s)
(write-char char s))
......@@ -35,7 +37,6 @@ Downcase symbol names but leave strings alone."
(t (e)
(progn (warn "Failed to form arglist for ~A: ~A" symbol e)
(list "")))))
(defvar *type-alist*
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