<commit_before>(ns one.repmax.snippets
  "Macros for including HTML snippets in the ClojureScript application
  at compile time."
  (:use [one.templates :only (render)])
  (:require [net.cgrand.enlive-html :as html]))

(defn- snippet [file id]
  (render (html/select (html/html-resource file) id)))

(def ^{:private true}
  exercises-list-template
  (let [list-with-sample-items (html/select (html/html-resource "exercises.html") [:#exercise-list])
        empty-list (html/at list-with-sample-items [:div :ol] (html/content ""))]
    (render empty-list)))

(def ^{:private true}
  exercises-list-item-template
  (let [sample-list-item (html/select (html/html-resource "exercises.html") [:#exercise-list :ol :li] :first)
        list-item-without-content (html/at sample-list-item [:.list-item-label] (html/content ""))]
    (render list-item-without-content)))

(defmacro snippets
  "Expands to a map of HTML snippets which are extracted from the
  design templates."
  []
  {:exercises-header    (snippet "exercises.html" [:#header])
   :exercises-search    (snippet "exercises.html" [:#search-bar])
   :exercises-list      exercises-list-template
   :exercises-list-item exercises-list-item-template})
<commit_msg>Fix Enlive selector syntax in snippets.clj<commit_after>(ns one.repmax.snippets
  "Macros for including HTML snippets in the ClojureScript application
  at compile time."
  (:use [one.templates :only (render)])
  (:require [net.cgrand.enlive-html :as html]))

(defn- snippet [file id]
  (render (html/select (html/html-resource file) id)))

(def ^{:private true}
  exercises-list-template
  (let [list-with-sample-items (html/select (html/html-resource "exercises.html") [:#exercise-list])
        empty-list (html/at list-with-sample-items [:div :ol] (html/content ""))]
    (render empty-list)))

(def ^{:private true}
  exercises-list-item-template
  (let [sample-list-item (html/select (html/html-resource "exercises.html") [:#exercise-list :ol [:li html/first-of-type]])
        list-item-without-content (html/at sample-list-item [:.list-item-label] (html/content ""))]
    (render list-item-without-content)))

(defmacro snippets
  "Expands to a map of HTML snippets which are extracted from the
  design templates."
  []
  {:exercises-header    (snippet "exercises.html" [:#header])
   :exercises-search    (snippet "exercises.html" [:#search-bar])
   :exercises-list      exercises-list-template
   :exercises-list-item exercises-list-item-template})

{'fraction_non_alphanumeric': 0.15542995559144127, 'fraction_numerical': 0.0, 'mean_word_length': 4.077868852459017, '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': '7578963', 'n_tokens_mistral': 859, 'n_tokens_neox': 838, 'n_words': 199}