     (str "https://github.com/clojure/" repo "/blob/" version "/" strip-path
          "#L" start-line "-L" end-line)))
 
+(defn clj-tag->version
+  [v]
+  (if-let [[_ semver] (re-find #"clojure-(.*)" v)]
+    semver
+    v))
+
+(defn cljs-tag->version
+  [v]
+  (if-let [[_ number] (re-find #"r(.*)"v )]
+    (str "0.0-" number)
+    v))
+
 ;;------------------------------------------------------------
 ;; Docs Repo
 ;;------------------------------------------------------------

          (let [parsed (attach-history-to-items parsed (:version-map @history))]
            (dump-api-docs! parsed))

          (println "\nCommitting docs at tag" version "...")
          (commit-docs-repo! version))

        (println "\nDone."))))


      (docs-repo-out-of-sync! (str version " already has tag")))))

(defn clear-docs-repo!
  []
  (git-docs-repo! "rm" "-rf" "."))

(defn commit-docs-repo!
  []
  (let [clj-t  (get *repo-version* "clojure")
        cljs-t (get *repo-version* "clojurescript")
        clj-v  (clj-tag->version clj-t)
        cljs-v (cljs-tag->version cljs-t)
        msg (str cljs-v "\n"
                 "\n"
                 "- auto-generated by cljs-api-parser\n"
                 "  https://github.com/shaunlebron/cljs-api-parser\n"
                 "\n"
                 "- parsed from:\n"
                 "  ClojureScript " cljs-v "\n"
                 "  Clojure " clj-v "\n")]
    (git-docs-repo! "add" ".")
    (git-docs-repo! "commit" "-m" msg)
    (git-docs-repo! "tag" cljs-v)))

;;------------------------------------------------------------
;; Repo Helpers
