 
 (defn- md-renderer
   "Create a Markdown renderer."
-  []
+  [function->category-info]
   (.. (HtmlRenderer/builder
        (doto (MutableDataSet.)
          (.set AnchorLinkExtension/ANCHORLINKS_ANCHOR_CLASS "md-anchor")

    (assoc mt
           :args args
           :name name
           :docstring (markdown-to-html docstring)
           :what (if (= 'defmacro type) :macro :fn)
           :link (link-to-processing-reference mt))))

(defn get-metas [forms type]
  (->> forms
       get-public-fns
       (map get-full-meta)
       (map #(assoc % :type type))
       (map #(vector (:name %) %))
       (into {})))

(defn merge-metas [meta1 meta2]
  (let [args1 (:args meta1)

            (reify LinkResolver
              (resolveLink [_this _node _ctx link]
                (if (= (.getLinkType link) WikiLinkExtension/WIKI_LINK)
                  (let [function-name (.getUrl link)
                        {:keys [category subcategory]} (get function->category-info function-name)]
                    (ResolvedLink. LinkType/LINK
                                 (wiki-link function-name category subcategory)
                                 nil
                                 LinkStatus/UNCHECKED))
                  link))))))
      (extensions md-extensions)
      (build)))

(defn markdown-to-html
  "Parse the given string as Markdown and return HTML."
  [markdown function->category-info]
  (->> (.parse md-container markdown)
       (.render (md-renderer function->category-info))))

(defn read-all [file feature]
  (let [reader (->> file
