<commit_before>;; Example of using clj-chrome-devtools with babashka
;;
;; Make a .classpath
;; $ clj -A:bb -Spath > .classpath
;;
;; Start Chrome in the background:
;; /some/chrome-binary --remote-debugging-port=9222 --headless &
;;
;; Run with:
;; $ bb --classpath $(cat .classpath) bb.clj

(require '[clj-chrome-devtools.core :as core]
         '[clj-chrome-devtools.automation :as auto])

(println "Printing to bb.pdf")
(def a (auto/create-automation (core/connect)))
(auto/to a "https://babashka.org")
(auto/print-pdf a "bb.pdf"
                {:print-background true
                 :paper-width 8.3
                 :paper-height 11.7})<commit_msg>Use babashka.deps instead of creating a separate .classpath file<commit_after>;; Example of using clj-chrome-devtools with babashka
;;
;; Start Chrome in the background:
;; /some/chrome-binary --remote-debugging-port=9222 --headless &
;;
;; Run with:
;; $ bb bb.clj

(require '[babashka.deps :as deps])
(deps/add-deps
 '{:deps {tatut/devtools {:git/url "https://github.com/tatut/clj-chrome-devtools"
                          :git/sha "cc96255433ca406aaba8bcee17d0d0b3b16dc423"}
          org.babashka/spec.alpha {:git/url "https://github.com/babashka/spec.alpha"
                                   :git/sha "1a841c4cc1d4f6dab7505a98ed2d532dd9d56b78"}}})

(require '[clj-chrome-devtools.core :as core]
         '[clj-chrome-devtools.automation :as auto])

(println "Printing to bb.pdf")
(def a (auto/create-automation (core/connect)))
(auto/to a "https://babashka.org")
(auto/print-pdf a "bb.pdf"
                {:print-background true
                 :paper-width 8.3
                 :paper-height 11.7})
{'fraction_non_alphanumeric': 0.15435435435435435, 'fraction_numerical': 0.03783783783783784, 'mean_word_length': 2.769230769230769, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7398284', 'n_tokens_mistral': 630, 'n_tokens_neox': 585, 'n_words': 125}