From 2742fd7bc38999287b9ee7de9f3b94f8d1ac5cc0 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Tue, 8 Feb 2022 15:19:12 -0600 Subject: changed route format in documentation, updated example documentation --- example/lazybones-test-docs.md | 4 ++-- lazybones-documentation.lisp | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/example/lazybones-test-docs.md b/example/lazybones-test-docs.md index e7133f1..12effa8 100644 --- a/example/lazybones-test-docs.md +++ b/example/lazybones-test-docs.md @@ -36,7 +36,7 @@ Dummy login endpoint for returning a session cookie. Always returns the "true" and sends a set-cookie header, setting 'testappsession' to 'coolsessionbro'. -### GET /person/:person person-by-id: +### GET /person/:person: *application/json* Route Variables: @@ -59,7 +59,7 @@ Echo the search parameters in a nice list, but also has a post-body Echo the search parameters in a nice list. -### GET /search/:category to-int: +### GET /search/:category: *text/plain* Route Variables: diff --git a/lazybones-documentation.lisp b/lazybones-documentation.lisp index c7cd591..b64ec63 100644 --- a/lazybones-documentation.lisp +++ b/lazybones-documentation.lisp @@ -25,7 +25,7 @@ (dolist (ep (sorted-endpoints endpoints)) (with-slots (method content-type route authorizer endpoint-documentation) ep newline - (princ "### ") (princ method) (princ " ") (princ route) + (princ "### ") (princ method) (princ " ") (princ (make-route-presentable route)) (terpri) (princ "*") (princ (if content-type content-type default-content-type )) @@ -71,3 +71,6 @@ (defun route-var-value-parser (ep var) (second (assoc var (remove-if-not #'consp (endpoint-dispatch-pattern ep))))) + +(defun make-route-presentable (routestring) + (ppcre:regex-replace-all " [a-z0-9A-Z\-]+:" routestring ":")) -- cgit v1.2.3