From da9f8ba322ea1de0db5fdfd04891c595e0ff91d8 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Tue, 8 Feb 2022 10:38:48 -0600 Subject: hacking on documentation module --- lazybones-documentation.lisp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'lazybones-documentation.lisp') diff --git a/lazybones-documentation.lisp b/lazybones-documentation.lisp index bb94515..16164c5 100644 --- a/lazybones-documentation.lisp +++ b/lazybones-documentation.lisp @@ -24,20 +24,33 @@ newline (princ "## Endpoints") (dolist (ep (sorted-endpoints endpoints)) - (with-slots (method route authorizer endpoint-documentation) ep + (with-slots (method content-type route authorizer endpoint-documentation) ep newline (princ "### ") (princ method) (princ " ") (princ route) + (terpri) + (princ "*") + (princ (if content-type content-type default-content-type )) + (princ "*") newline (when authorizer (princ "Authorization Required: ") + newline (cond ((function-or-function-name-p authorizer) - (princ (documentation authorizer 'function))) + (princ (ensure-blockquote (documentation authorizer 'function)))) ((function-or-function-name-p default-authorizer) - (princ (documentation default-authorizer 'function)))) + (princ (ensure-blockquote (documentation default-authorizer 'function))))) newline) (princ endpoint-documentation) )))))) +(defun ensure-blockquote (string) + (concatenate 'string "> " + (str:replace-all + '(#\newline) + " +> " + string))) + (defun function-or-function-name-p (thing) (or (functionp thing) (and (symbolp thing) (fboundp thing)))) -- cgit v1.2.3