Changeset 13689
- Timestamp:
- 11/02/11 13:12:07 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/doc/manual/grovel.lisp
r13686 r13689 1 1 #-abcl We're only grovelling ABCL docstrings here. 2 2 (defun grovel-docstrings-as-tex (&optional (package (find-package :java))) 3 (with-open-file (stream "java.tex" :direction :output) 4 (loop :for symbol :being :each :external-symbol :of package 5 :doing (format stream "~&~A~%~%"(symbol-as-tex symbol))))) 3 (let ((output-file (format nil "~A.tex" (string-downcase (package-name package))))) 4 (with-open-file (stream output-file :direction :output) 5 (format t "Writing output to ~A.~%" output-file) 6 (loop :for symbol :being :each :external-symbol :of package 7 :doing (format stream "~&~A~%~%" (symbol-as-tex symbol)))))) 6 8 7 9 (asdf:load-system 'swank) ;; XXX Does this load the SWANK-BACKEND package as well … … 12 14 :collecting 13 15 (format nil 14 (if (string= (subseq (symbol-name arg) 0 1) #\&) 16 ;;; XXX should really check the entire input for TeX escapes 17 (if (and (symbolp arg) 18 (or (string= (subseq (symbol-name arg) 0 1) #\&) 19 (string= (subseq (symbol-name arg) 0 1) #\%))) 15 20 "\\~A" 16 21 "~A") 17 (string-downcase (symbol-name arg)))) 22 (if (symbolp arg) 23 (string-downcase (symbol-name arg)) 24 (format nil "~(~A~)" arg)))) 18 25 (t (e) 19 26 (progn (warn "Failed to form arglist for ~A: ~A" symbol e) … … 22 29 23 30 (defvar *type-alist* 24 '((:function . "Function") 25 (:macro . "Macro") 26 (:variable . "Variable") 27 (:class . "Class") 28 (:generic-function . "Generic Function"))) 31 '((:function 32 . "Function") 33 (:macro 34 . "Macro") 35 (:variable 36 . "Variable") 37 (:class 38 . "Class") 39 (:special-operator 40 . "Special Operator") 41 (:generic-function 42 . "Generic Function"))) 29 43 30 44 (defun symbol-as-tex (symbol) … … 49 63 (setf type :class 50 64 documentation (second doc))) 65 ((find :special-operator doc) 66 (setf type :special-operator 67 documentation (second doc))) 51 68 (t 52 69 (warn "Unknown type of documentation for symbol ~A: ~A" … … 56 73 package-name (string-downcase 57 74 (package-name (find-package (symbol-package symbol))))) 58 (format nil "\\label{~A:~A}~&--- ~A: \\textbf{~A} [\\textbf{~A}] \\textit{~A}~%~%~A" 75 (format nil "~&\\paragraph{}~&\\label{~A:~A}~&\\index{~A}~&--- ~A: \\textbf{~A} [\\textbf{~A}] \\textit{~A}~%~%\\begin{adjustwidth}{5em}{5em}~&~A~&\\end{adjustwidth}" 76 (package-name (find-package (symbol-package symbol))) 59 77 (symbol-name symbol) 60 ( package-name (find-package (symbol-package symbol)))78 (symbol-name symbol) 61 79 (cdr (assoc type *type-alist*)) 62 80 symbol-name
Note: See TracChangeset
for help on using the changeset viewer.