Skip to content

Commit

Permalink
Log when using source files
Browse files Browse the repository at this point in the history
  • Loading branch information
zampino committed Jul 26, 2023
1 parent 3ee2472 commit 7bd32d5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/nextjournal/clerk/builder.clj
Original file line number Diff line number Diff line change
Expand Up @@ -318,15 +318,18 @@
(spit (str tw-folder "/viewer.js")
(slurp (let [js-url (get resource->url "/js/viewer.js")]
(cond->> js-url (view/relative? js-url) (str out-path fs/file-separator)))))
(doseq [[src dest] (map (juxt #(io/resource (str "nextjournal/clerk/" %))
#(doto (fs/path tw-folder %) create-parent-dirs)) files-with-tw-classes)]
(fs/copy src dest {:replace-existing true})))
(do
(println "Tailwind: using cljs source files as input…")
(doseq [[src dest] (map (juxt #(io/resource (str "nextjournal/clerk/" %))
#(doto (fs/path tw-folder %) create-parent-dirs)) files-with-tw-classes)]
(fs/copy src dest {:replace-existing true}))))

(doseq [{:keys [file viewer]} docs]
(spit (let [path (fs/path tw-folder (str/replace (str file) #"\.(cljc?|md)$" ".edn"))]
(create-parent-dirs path)
(str path))
(pr-str viewer)))

(let [tw-command (if (zero? (:exit (try (sh "which tailwindcss") (catch Throwable _)))) "tailwindcss" "npx tailwindcss")
{:as ret :keys [out err exit]}
(try (sh tw-command
Expand Down

0 comments on commit 7bd32d5

Please sign in to comment.