<commit_before>(ns timber.selectors
  (:require [net.cgrand.enlive-html :as html]))

(def html [:html])
(def head [:head])
(def body [:body])

(def title [:title])

(def brand-title [:a#brand])

(def link-asset [[:link (html/attr? :asset)]])
(def js-asset [[:script (html/attr? :asset)]])

(def main-menu [:ul#main-menu-list])
(def user-menu [:ul#user-account-menu])
(def user-name [:a#user-menu-toggle])

(def link-template [[:link (html/attr? :template)]])
(def script-template [[:script (html/attr? :template)]])

(def content [:div#content])

(defn first-of-type
  "Searches the template for the first type of specified element"
  [type template]
  (html/select
    (html/html-resource (str "timber/templates/" template))
    [[type (html/nth-of-type 1)]]))
<commit_msg>Updated link and script selectors to be more specific.<commit_after>(ns timber.selectors
  (:require [net.cgrand.enlive-html :as html]))

(def html [:html])
(def head [:head])
(def body [:body])

(def title [:title])

(def brand-title [:a#brand])

(def link-asset [:head :link (html/attr? :asset)])
(def link-template [:head :link (html/attr? :template)])
(def js-asset [:head :script (html/attr? :asset)])
(def script-template [:script (html/attr? :template)])

(def main-menu [:ul#main-menu-list])
(def user-menu [:ul#user-account-menu])
(def user-name [:a#user-menu-toggle])

(def content [:div#content])

(defn first-of-type
  "Searches the template for the first type of specified element"
  [type template]
  (html/select
    (html/html-resource (str "timber/templates/" template))
    [[type (html/nth-of-type 1)]]))

{'fraction_non_alphanumeric': 0.1939924906132666, 'fraction_numerical': 0.0012515644555694619, 'mean_word_length': 4.835766423357664, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4110517', 'n_tokens_mistral': 591, 'n_tokens_neox': 584, 'n_words': 161}