1 (in-package #:docgen-pkg)
3 (defun fire-error (msg) (error (make-instance 'docgen:validation-failure :msg msg)))
11 ((< 120 (length str)) (fire-error (format nil "Package description longer than 120 characters: ~A" str)))
12 ((cl-ppcre:scan "^ " str) (fire-error (format nil "Package description line started with space: ~A" str)))
13 ((cl-ppcre:scan " $" str) (fire-error (format nil "Package description line ended with space: ~A" str)))))
17 ((not strs) (list ""))
18 ((string= "" (car strs)) (cons "" (combine (cdr strs))))
21 ((rest (combine (cdr strs))))
22 (cons (format nil "~A~A~A" (car strs) (if (string/= "" (car rest)) " " "") (car rest)) (cdr rest)))))))
24 ((lines (cl-ppcre:split "\\n" (documentation pkg t))))
27 ((paragraphs (combine lines)))
28 (when (< 120 (length (first paragraphs))) (fire-error "First package paragraph is longer than 120 characters"))
29 (when (find "" paragraphs :test #'string=) (fire-error "Package description has two empty lines in it"))
30 (cons (package-name pkg) paragraphs)))))
33 (format nil "# Package ~A~%~%~{~A~^~%~%~}"