-
Notifications
You must be signed in to change notification settings - Fork 11
/
types.clj
29 lines (19 loc) · 864 Bytes
/
types.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
(ns stencil.types)
(set! *warn-on-reflection* true)
(def open-tag "{%")
(def close-tag "%}")
(defprotocol ControlMarker)
;; Invocation of a fragment by name
(defrecord FragmentInvoke [result] ControlMarker)
;; Tells if a table column should be hidden in a postprocess step.
(defrecord HideTableColumnMarker [columns-resize] ControlMarker)
(def column-resize-modes #{:resize-first :resize-last :rational :cut})
(defn ->HideTableColumnMarker
([] (HideTableColumnMarker. :cut))
([x] (assert (column-resize-modes x))
(HideTableColumnMarker. x)))
;; Tells if a table row should be hidden in a postprocess step.
(defrecord HideTableRowMarker [] ControlMarker)
(defn hide-table-column-marker? [x] (instance? HideTableColumnMarker x))
(defn hide-table-row-marker? [x] (instance? HideTableRowMarker x))
(defn control? [x] (satisfies? ControlMarker x))