This commit is contained in:
@@ -331,7 +331,9 @@
|
|||||||
(s/def ::contents-begin nat-int?)
|
(s/def ::contents-begin nat-int?)
|
||||||
(s/def ::contents-end nat-int?)
|
(s/def ::contents-end nat-int?)
|
||||||
|
|
||||||
(defmulti node-spec :type)
|
(defmulti object-spec :type)
|
||||||
|
(defmulti recursive-object-spec :type)
|
||||||
|
(defmulti element-spec :type)
|
||||||
|
|
||||||
(def ^:private nfe
|
(def ^:private nfe
|
||||||
"NFE — “no further expectations.” Used in sub-specs of `::element`
|
"NFE — “no further expectations.” Used in sub-specs of `::element`
|
||||||
@@ -359,13 +361,16 @@
|
|||||||
(dict ^:opt {:contents-begin ::contents-begin
|
(dict ^:opt {:contents-begin ::contents-begin
|
||||||
:contents-end ::contents-end}
|
:contents-end ::contents-end}
|
||||||
{:children (s/coll-of ::object :kind vector?)
|
{:children (s/coll-of ::object :kind vector?)
|
||||||
|
#_#_
|
||||||
:type ::recursive-object-type}))
|
:type ::recursive-object-type}))
|
||||||
|
|
||||||
(s/def ::object
|
(s/def ::object
|
||||||
(s/merge ::object-base (s/multi-spec node-spec :type)))
|
(s/merge ::object-base
|
||||||
|
(s/multi-spec object-spec :type)))
|
||||||
|
|
||||||
(s/def ::recursive-object
|
(s/def ::recursive-object
|
||||||
(s/merge ::recursive-object-base (s/multi-spec node-spec :type)))
|
(s/merge ::recursive-object-base
|
||||||
|
(s/multi-spec recursive-object-spec :type)))
|
||||||
|
|
||||||
(s/def ::todo-keyword string?)
|
(s/def ::todo-keyword string?)
|
||||||
(s/def ::priority string?)
|
(s/def ::priority string?)
|
||||||
@@ -378,11 +383,11 @@
|
|||||||
|
|
||||||
(def ^:private string-value (dict {:value string?}))
|
(def ^:private string-value (dict {:value string?}))
|
||||||
|
|
||||||
(defmethod node-spec "text" [_] (s/merge string-value))
|
(defmethod object-spec "text" [_] string-value)
|
||||||
(defmethod node-spec "verbatim" [_] string-value)
|
(defmethod object-spec "verbatim" [_] string-value)
|
||||||
(defmethod node-spec "code" [_] string-value)
|
(defmethod object-spec "code" [_] string-value)
|
||||||
(defmethod node-spec "bold" [_] nfe)
|
(defmethod recursive-object-spec "bold" [_] nfe)
|
||||||
(defmethod node-spec "italic" [_] nfe)
|
(defmethod recursive-object-spec "italic" [_] nfe)
|
||||||
|
|
||||||
|
|
||||||
;;; Specs (specific elements)
|
;;; Specs (specific elements)
|
||||||
|
|||||||
Reference in New Issue
Block a user