Skip to content

Commit

Permalink
add portal notebook middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
seancorfield committed May 31, 2023
1 parent 00f0d55 commit 6d7bb84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ The `:dev/repl` alias calls `org.corfield.dev.repl/start-repl` in the [`repl.clj

* Optionally, starts a Socket REPL server (with the port selected via an environment variable, a JVM property, or a dot-file created on a previous run).
* If both Portal and `org.clojure/tools.logging` are on the classpath, it patch `tools.logging` to also `tap>` every log message in a format that Portal understands and can display (usually with the ability to go to the file/line listed in the log entry); call `(dev/toggle-logging!)` to turn this `tap>`'ing on and off.
* If Portal 0.33.0 or later is on the classpath, use the Portal middleware with nREPL (if CIDER or nREPL are on the classpath).
* If Portal 0.33.0 or later is on the classpath, use the Portal middleware with nREPL (if CIDER or nREPL are on the classpath). If using Portal 0.40.0 or later, this also adds the [Portal Notebook middleware](https://cljdoc.org/d/djblue/portal/0.40.0/doc/editors/vs-code/clojure-notebooks#portalnreplwrap-notebook).
* Starts [Figwheel Main](https://github.com/bhauman/figwheel-main), if present on the classpath, else
* Starts [Rebel Readline](https://github.com/bhauman/rebel-readline), if present on the classpath, else
* Starts a CIDER-enhanced [nREPL Server](https://nrepl.org/), if `cider-nrepl` is present on the classpath, else
Expand Down
5 changes: 3 additions & 2 deletions src/org/corfield/dev/repl.clj
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@
middleware
(into []
(filter #(try (requiring-resolve (second %)) true (catch Throwable _)))
[["Portal" 'portal.nrepl/wrap-portal]
["CIDER" 'cider.nrepl/cider-middleware]])
[["Portal" 'portal.nrepl/wrap-portal]
["Notebook" 'portal.nrepl/wrap-notebook]
["CIDER" 'cider.nrepl/cider-middleware]])
mw-args
(when (seq middleware)
["--middleware" (str (mapv second middleware))])
Expand Down

0 comments on commit 6d7bb84

Please sign in to comment.