commit 1d8be681a5a3ab733c4da782dbc0d0318bc5ae55
parent 534e01650d00df913e665e4f3a881286de93007f
Author: Decay <decay@todayiwilllaunchmyinfantsonintoorbit.com>
Date: Wed, 18 Dec 2024 20:34:43 -0800
Enable 3BMD-EXT-CODE-BLOCKS
Add support for ``` code blocks with simple syntax highlighting via
COLORIZE. See https://github.com/3b/3bmd/ for more information
(including how to use Chroma or Pygments instead of COLORIZE)
Diffstat:
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/miniblog.asd b/miniblog.asd
@@ -19,6 +19,7 @@ into date-structured directories as a normal HTML."
"mito"
"esrap"
"3bmd"
+ "3bmd-ext-code-blocks"
"local-time"
"str"
"command-line-arguments")
diff --git a/src/format.lisp b/src/format.lisp
@@ -21,7 +21,8 @@
(defun markdown (content &optional collapse-link)
"Translate CONTENT with 3bmd. If COLLAPSE-LINK is NIL then unconditionally render the full post, otherwise cut at the first ---."
- (let ((md-content (with-output-to-string (os)
+ (let* ((3bmd-code-blocks:*code-blocks* t)
+ (md-content (with-output-to-string (os)
(3bmd:parse-string-and-print-to-stream content os))))
(if collapse-link
(truncate-and-emit-read-more md-content collapse-link)