<commit_before>(ns matross.tasks.template
  (:require [matross.tasks.core :refer [deftask run-task]]
            [clostache.parser :as template]))


(deftask :template [conn {:keys [dest vars file content]}]

  (comment
    :dest where to put the templated content
    :vars for template substitution
    :file a file to render
    :content a string to render (optional, instead of :file))

  (let [content (if file (slurp file) content)
        rendered (template/render content vars)]
    (run-task
     conn
     {:type :stream-to-file
      :dest dest
      :src rendered})))<commit_msg>renamed input key for clarity<commit_after>(ns matross.tasks.template
  (:require [matross.tasks.core :refer [deftask run-task]]
            [clostache.parser :as template]))


(deftask :template [conn {:keys [dest vars file inline]}]

  (comment
    :dest where to put the templated content
    :vars for template substitution
    :file a file to render
    :inline a string to render (optional, instead of :file))

  (let [content (if file (slurp file) inline)
        rendered (template/render content vars)]
    (run-task
     conn
     {:type :stream-to-file
      :dest dest
      :src rendered})))
{'fraction_non_alphanumeric': 0.10711297071129706, 'fraction_numerical': 0.0, 'mean_word_length': 3.0819112627986347, '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': '3203901', 'n_tokens_mistral': 362, 'n_tokens_neox': 353, 'n_words': 129}