From 21a4d9f162a5d4bc52e9184e7e0689c804109363 Mon Sep 17 00:00:00 2001 From: pbaille Date: Sat, 14 Dec 2024 01:10:02 +0100 Subject: [PATCH] switch to FencedBlocks --- scripts/create_client_guide_ns.clj | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/create_client_guide_ns.clj b/scripts/create_client_guide_ns.clj index 36e28e4..188d639 100644 --- a/scripts/create_client_guide_ns.clj +++ b/scripts/create_client_guide_ns.clj @@ -2,7 +2,7 @@ (:require [commonmark-hiccup.core :as h] [clojure.string :as str])) -(defmethod h/node-properties org.commonmark.node.IndentedCodeBlock [node] +(defmethod h/node-properties org.commonmark.node.FencedCodeBlock [node] (h/property-map node)) (defmethod h/node-properties org.commonmark.node.Code [node] @@ -27,8 +27,11 @@ (self content)) (self remaining))) - (= :pre h) (cons (list '$ 'noon.client.ui/code-editor {:source (str/trim (second (second x)))}) - (self xs)) + (= :pre h) (let [[_ [_ props source]] x] + (cons (list '$ 'noon.client.ui/code-editor + (merge props + {:source (str/trim source)})) + (self xs))) (seq? (second x)) (cons (concat (list '$ h) (self (second x))) (self xs))