aboutsummaryrefslogtreecommitdiff
path: root/lazybones-documentation.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lazybones-documentation.lisp')
-rw-r--r--lazybones-documentation.lisp19
1 files changed, 16 insertions, 3 deletions
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))))