             [om.core :as om :include-macros true]
             [om.dom :as dom :include-macros true]
             [frontend.components.common :as common]
+            [frontend.controllers.navigation :as navigation]
             [frontend.state :as state]
             [frontend.utils :as utils :include-macros true]
             [frontend.utils.ajax :as ajax]


(defrender documentation [app owner opts]
  (let [subpage (get-in app [:navigation-data :subpage])
        docs (get-in app state/docs-data-path)
        categories ((juxt :gettingstarted :languages :how-to :troubleshooting
                          :reference :parallelism :privacy-security) docs)]

(defn docs-subpage [doc owner]
  (reify
    om/IDidMount
    (did-mount [_]
      (add-link-targets (om/get-node owner))
      (navigation/scroll-to-fragment! (-> owner om/get-state :_fragment)))
    om/IDidUpdate
    (did-update [_ _ _]
      (add-link-targets (om/get-node owner))
      (navigation/scroll-to-fragment! (-> owner om/get-state :_fragment)))
    om/IRender
    (render [_]
      (html
