         matches (re-seq #"(?s)\{\{(\w+) ([^\}]+)\}\}" body)
         args (map rest matches)]
     (map preprocess args)))
+
++;; hotlinks
+
+(defn hotlink-to-html
+  [id [type number]]
+  (html [:a {:class (str "hotlink" " " type)
+             :href (post-href id type number)}
+         number]))
+
+(defn get-hotlink-id
+  [nid-map number]
+  (get nid-map (get-whole-number number)))
+
+(defn get-hotlink-ids
+  [nid-map numbers]
+  (map (partial get-hotlink-id nid-map) numbers))
+
+(defn preprocess-hotlinks
+  [{:keys [nid-map body properties]}]
+  (let [matches (re-seq #"!\[(\w+) ([\d\.]+)\][^\(]" body)
+        args (map rest matches)
+        ids (get-hotlink-ids nid-map (map second args))]
+    (map hotlink-to-html ids args)))
 
 (defn preprocess-md
   [nid-map body properties]

  (:require [ssblog.util :refer [get-basename re-seq-to-map
                                 find-files-by-type process-files
                                 get-config split-file-on]]
            [hiccup.core :as html])
  (:import [java.io File]
           [org.pegdown PegDownProcessor Extensions]))

(defn get-mdbuild-config
  ([] (get-mdbuild-config {}))


(defn href-with-root
  [root & paths]
  (string/join "/" (list* root paths)))

(def post-href (partial href-with-root "#/post"))

