#!/usr/bin/env bb

(ns changelog
  (:require [clojure.string :as str]))

(let [changelog (slurp "CHANGELOG.md")
      replaced (str/replace changelog
                            #" #(\d+)"
                            (fn [[_ issue after]]
                              (format " [#%s]()%s"
                                      issue issue (str after))))
      replaced (str/replace replaced
                            #"@([a-zA-Z0-9-_]+)([, \.)])"
                            (fn [[_ name after]]
                              (format "[@%s]()%s"
                                      name name after)))]
  (spit "CHANGELOG.md" replaced))

#!/usr/bin/env bb

(ns changelog
  (:require [clojure.string :as str]))

(let [changelog (slurp "CHANGELOG.md")
      replaced (str/replace changelog
                            #" #(\d+)"
                            (fn [[_ issue after]]
                              (format " [#%s]()%s"
                                      issue issue (str after))))
      replaced (str/replace replaced
                            #"@([a-zA-Z0-9-_]+)([, \.)])"
                            (fn [[_ name after]]
                              (format "[@%s]()%s"
                                      name name after)))]
  (spit "CHANGELOG.md" replaced))
