diff --git a/deps.edn b/deps.edn index d9630228..72064b56 100644 --- a/deps.edn +++ b/deps.edn @@ -52,7 +52,8 @@ org.babashka/cli {:mvn/version "0.8.65"} org.babashka/http-client {:mvn/version "0.4.22"} org.flatland/ordered {:mvn/version "1.15.12"} - org.jsoup/jsoup {:mvn/version "1.20.1"}} + org.jsoup/jsoup {:mvn/version "1.20.1"} + io.github.nextjournal/markdown {:mvn/version "0.6.157"}} :aliases {:babashka/dev {:main-opts ["-m" "babashka.main"]} :profile diff --git a/project.clj b/project.clj index 0ea83a77..0486ca32 100644 --- a/project.clj +++ b/project.clj @@ -37,6 +37,7 @@ [org.babashka/cli "0.8.65"] [org.babashka/http-client "0.4.22"] [org.jsoup/jsoup "1.20.1"] + [io.github.nextjournal/markdown "0.6.157"] [borkdude/graal.locking "0.0.2"]] :plugins [[org.kipz/lein-meta-bom "0.1.1"]] :metabom {:jar-name "metabom.jar"} diff --git a/resources/META-INF/babashka/deps.edn b/resources/META-INF/babashka/deps.edn index c8dbd20b..72064b56 100644 --- a/resources/META-INF/babashka/deps.edn +++ b/resources/META-INF/babashka/deps.edn @@ -52,7 +52,8 @@ org.babashka/cli {:mvn/version "0.8.65"} org.babashka/http-client {:mvn/version "0.4.22"} org.flatland/ordered {:mvn/version "1.15.12"} - org.jsoup/jsoup {:mvn/version "1.20.1"}} + org.jsoup/jsoup {:mvn/version "1.20.1"} + io.github.nextjournal/markdown {:mvn/version "0.6.157"}} :aliases {:babashka/dev {:main-opts ["-m" "babashka.main"]} :profile @@ -176,7 +177,9 @@ org.clj-commons/hickory {:git/url "https://github.com/clj-commons/hickory" :git/sha "9385b6708ef35f161732d8464b3a3aa57dd79f30"} com.potetm/fusebox {:git/url "https://github.com/potetm/fusebox" - :git/sha "ac6d6a0a69510b009b3c1bb2247cd110fd9f7246"}} + :git/sha "ac6d6a0a69510b009b3c1bb2247cd110fd9f7246"} + net.sekao/odoyle-rules {:git/url "https://github.com/oakes/odoyle-rules" + :git/sha "0b1d825ec45a998c4d3481dfb292e08ce6a47f0b"}} :classpath-overrides {org.clojure/clojure nil org.clojure/spec.alpha nil}} :clj-nvd diff --git a/resources/META-INF/native-image/babashka/babashka/native-image.properties b/resources/META-INF/native-image/babashka/babashka/native-image.properties index f6db946b..8d851f35 100644 --- a/resources/META-INF/native-image/babashka/babashka/native-image.properties +++ b/resources/META-INF/native-image/babashka/babashka/native-image.properties @@ -15,6 +15,8 @@ Args=-H:+ReportExceptionStackTraces \ --initialize-at-build-time=com.fasterxml.jackson \ --initialize-at-build-time=java.sql.SQLException \ --initialize-at-build-time=org.yaml.snakeyaml \ + --initialize-at-build-time=org.nibor.autolink \ + --initialize-at-build-time=org.commonmark \ --initialize-at-run-time=org.postgresql.sspi.SSPIClient \ --initialize-at-run-time=org.httpkit.client.ClientSslEngineFactory$SSLHolder \ -H:ServiceLoaderFeatureExcludeServices=javax.sound.sampled.spi.AudioFileReader \ diff --git a/src/babashka/impl/markdown.clj b/src/babashka/impl/markdown.clj new file mode 100644 index 00000000..5f70d907 --- /dev/null +++ b/src/babashka/impl/markdown.clj @@ -0,0 +1,17 @@ +(ns babashka.impl.markdown + (:require [nextjournal.markdown] + [nextjournal.markdown.transform] + [nextjournal.markdown.impl :as impl] + [sci.core :as sci])) + +@@#'impl/visitChildren-meth + +(def mdns (sci/create-ns 'nextjournal.markdown nil)) + +(def markdown-namespace (sci/copy-ns nextjournal.markdown mdns)) + +(def mdtns (sci/create-ns 'nextjournal.markdown.transform nil)) + +(def markdown-transform-namespace (sci/copy-ns nextjournal.markdown.transform mdtns)) + + diff --git a/src/babashka/main.clj b/src/babashka/main.clj index 773cc7fb..9a8c554d 100644 --- a/src/babashka/main.clj +++ b/src/babashka/main.clj @@ -39,6 +39,7 @@ [babashka.impl.http-client :refer [http-client-namespace http-client-websocket-namespace http-client-interceptors-namespace]] + [babashka.impl.markdown :as md] [babashka.impl.nrepl-server :refer [nrepl-server-namespace]] [babashka.impl.pods :as pods] [babashka.impl.pprint :refer [pprint-namespace]] @@ -432,7 +433,9 @@ Use bb run --help to show this help output. 'babashka.cli cli/cli-namespace 'babashka.http-client http-client-namespace 'babashka.http-client.websocket http-client-websocket-namespace - 'babashka.http-client.interceptors http-client-interceptors-namespace} + 'babashka.http-client.interceptors http-client-interceptors-namespace + 'nextjournal.markdown md/markdown-namespace + 'nextjournal.markdown.transform md/markdown-transform-namespace} features/xml? (assoc 'clojure.data.xml @(resolve 'babashka.impl.xml/xml-namespace) 'clojure.data.xml.event @(resolve 'babashka.impl.xml/xml-event-namespace) 'clojure.data.xml.tree @(resolve 'babashka.impl.xml/xml-tree-namespace))