                        (cons [:h3.subcategory
                               {:id (as-url (:name subcat))}
                               (:name subcat)]
-                             (map function->html (:fns subcat))))]
-    [:div.fns-wrapper
-     [:h2 name]
-     (map function->html fns)
-     (mapcat subcat->html (vals subcategories))]))
+                             (map function->html (:fns subcat))))
+        subcat->toc (fn [subcat]
+                      (cons [:h4.subcategory (link (:name subcat) nil (:name subcat))]
+                            (map #(vector :p.function (link % nil %)) (:fns subcat))))]
+    (list
+     [:div#toc
+      [:h3 (link "Back to index" "index")]
+      [:h3.category (link name name)]
+      (map #(vector :p.function (link % nil %)) fns)
+      (map subcat->toc (vals subcategories))]
+
+     [:div.fns-wrapper
+      [:h2 name]
+      (map function->html fns)
+      (mapcat subcat->html (vals subcategories))])))
 
 (defn generate-index-page [categories-map]
   (letfn [(fns->html [fns linkify]


;(generate-all @(resolve 'quil.core/fn-metas) "out")


  (garden.core/css

   [[:body {:color "#333"}]
    [:a {:color "#333"}]
    [:p {:margin "0px"}]

    [:.category-div :#toc
     [:.category {:margin "0px 0px 7px 0px"}
      [:a {:color "#990099"}]]
     [:.subcategory {:margin "15px 0px 0px 0px"}
      [:a {:color "#009900"}]]
     [:.function {:margin-top "2px"}]]

    [:.index-page
     [:.wrapper {:margin "auto"
