 
 #_(required-keys 'FigOpts :hello :goodbye)
 
+(defn doc-type? [x]
+  (and (map? x)
+       (= #{:content :example} (set (keys x)))
+       (let [{:keys [example content]} x]
+         (or (fn? example)
+             (string? example)))))
+
+(defn doc-key-val [root k d]
+  (cond
+    (string?   d) [[root :doc-key k d]]
+    (doc-type? d) [[root :doc-key k (:content d)]
+                   [root :doc-key-example k (:example d)]]))
+
 (defn doc
   ([root type-doc kd]
    (cons [root :doc-type type-doc]
-         (mapv (fn [[k d]] [root :doc-key k d]) kd)))
+         (mapcat (fn [[k d]] (doc-key-val root k d)) kd)))
   ([root type-doc]
    (doc root type-doc [])))
 

;; tighten up unknown-key errors to include information about current parent config

(defn type-doc [parent-type]
  (when-let [[_ _ d] (first (*schema-rules* [:doc-type parent-type]))]
    d))

(declare key-doc)

 (doc 'FigOpts "This is a cool option"
      {
       :hello ":hello is needed to say hello"
       :good ":good is needed to say goodbye"
       :hey-there {:content "This is docs"
                   :example "This is an example"}})) 

;; Direct Implementation
;; this is still squirrely
