                #(let [element (.getElementById js/document (str namespace "/" name))]
                   (.scrollIntoView element)) 
                200))
+
+(defroute search-route "/search/:search" [search]
+  (swap! app-state assoc :search search))
 
 (let [h (History.)]
   (goog.events/listen h EventType/NAVIGATE #(secretary/dispatch! (.-token %)))

    (r/alert {:bs-style "warning"}
             [(dom/h5 {} "Required when")
              (for [c conditions]
                (dom/li {} (codify c)))])))

(defn optionally-allowed-when [section k]
  (when-let [conditions (get-in model [section :model k :optionally-allowed-when])]
    (r/alert {:bs-style "success"}
             [(dom/h5 {} "Optionally allowed when")
              (for [c conditions]
                (dom/li {} (codify c)))])))

(defn deprecated [section k]
  (when-let [deprecated-version (get-in model [section :model k :deprecated-version])]

              {:key (name k)
               :id (str (keyword-sanitize-? k))}
              (dom/pre #js {:className "key-header"}
                       (dom/a #js {:href (str "#" (name section) "/" (keyword-sanitize-? k))}
                              (dom/i #js {:className "glyphicon glyphicon-link"}))
                       (str k)
                       (if deprecated? 
                         (r/badge {:class "deprecated-badge onyx-badge"} "deprecated"))
                       (requirements section k))
              (deprecated section k)
              (r/well {:class "entry-doc"} (codify (get-in model [section :model k :doc])))
              (when-let [doc-url (get-in model [section :model k :doc-url])] 
                (dom/a #js {:href doc-url :target "_blank"} (str "Documentation")))
              (dom/p {})
              (when-let [cheat-sheet-url (get-in model [section :model k :cheat-sheet-url])] 
                (dom/a #js {:href cheat-sheet-url} (str "Parameters")))


              (dom/p {})
              (restrictions model section k)
              (dom/p {})
              (required-when section k)
