Skip to content

Commit

Permalink
Don't parse a Python file if introduced via libpython-clj and instead…
Browse files Browse the repository at this point in the history
… return nil. This change fixes https://github.com/philippkueng/clerk-issue-531 and most likely will address nextjournal#531 too.
  • Loading branch information
philippkueng committed Sep 12, 2024
1 parent dbfeef2 commit 3c6fa84
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/nextjournal/clerk/parser.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,10 @@
#?(:clj
(defn parse-file
([file] (parse-file {} file))
([opts file] (-> (if (str/ends-with? file ".md")
(parse-markdown-string opts (slurp file))
(parse-clojure-string opts (slurp file)))
([opts file] (-> (cond
(str/ends-with? file ".md") (parse-markdown-string opts (slurp file))
(str/ends-with? file ".py") nil
:else (parse-clojure-string opts (slurp file)))
(assoc :file file)))))

#_(parse-file {:doc? true} "notebooks/visibility.clj")
Expand Down

0 comments on commit 3c6fa84

Please sign in to comment.