Skip to content

Commit 23f9a8c

Browse files
committed
Make rule 30 viewers more narrow so they don't affect the added viewers
1 parent 34962e3 commit 23f9a8c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

notebooks/rule_30.clj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@
1919
;; represent a value.
2020

2121
(clerk/add-viewers!
22-
[{:pred number? :render-fn '#(v/html [:div.inline-block {:style {:width 16 :height 16}
23-
:class (if (pos? %) "bg-black" "bg-white border-solid border-2 border-black")}])}
24-
{:pred list? :render-fn '#(v/html (into [:div.flex.flex-col] (v/inspect-children %2) %1))}
25-
{:pred #(and (vector? %) (not (map-entry? %))) :render-fn '#(v/html (into [:div.flex.inline-flex] (v/inspect-children %2) %1))}])
22+
[{:pred number?
23+
:render-fn '#(v/html [:div.inline-block {:style {:width 16 :height 16}
24+
:class (if (pos? %) "bg-black" "bg-white border-solid border-2 border-black")}])}
25+
{:pred (every-pred list? (partial every? (some-fn number? vector?)))
26+
:render-fn '#(v/html (into [:div.flex.flex-col] (v/inspect-children %2) %1))}
27+
{:pred (every-pred vector? (complement map-entry?) (partial every? number?))
28+
:render-fn '#(v/html (into [:div.flex.inline-flex] (v/inspect-children %2) %1))}])
2629

2730
;; Now let's test each one to make sure they look the way we want:
2831

0 commit comments

Comments
 (0)