For giggles :)
- Add this to your dependency:
[org.asciidoctor/asciidoctorj "1.5.5"]
- Minimal code snippet
(require '[clojure.java.io :as io])
(import 'org.asciidoctor.Asciidoctor)
(import 'org.asciidoctor.Asciidoctor$Factory)
(import 'java.util.HashMap)
(let [inst (Asciidoctor$Factory/create)
src (slurp (io/file "some-file.adoc"))]
(.convert inst src (HashMap.)))
-
Note the '$' from Asciidoctor$Factory; that is an inner class that must be accessed with the ugly '$' character.
-
There are many flavors of the .convert method. The one used here simply returns the rendered html as a string.