Fork me on GitHub
#reveal
<
2022-02-21
>
jlmr08:02:41

What is the best way to make sure everything from *err* and *out* ends up in a Reveal ui? Is this possible?

vlaaad09:02:19

Hmm, default reveal REPLs do that already, but I assume you are using non-default repl that does not forward prints to reveal...

vlaaad09:02:03

Perhaps you could try r/repl that forwards printing to Reveal window too?

jlmr10:02:21

I’m using Tutkain (Clojure plugin for Sublime text), which starts its own repl directly after connecting to a socket repl. Right now I’m connecting Tutkain to a plain socket repl and then run my own “Reveal repl” implementation on top of that:

(ns jlmr.socket-reveal
  (:require
   [clojure.core.server :as s]
   [clojure.main :as m]
   [vlaaad.reveal :as r]))

(defn- submit-eval-fn
  [submit]
  (fn [form]
    (let [value (eval form)]
      (submit value)
      value)))

(defn repl
  []
  (let [submit (r/ui)]
    (add-tap submit)
    (m/repl :init s/repl-init :read s/repl-read :eval (submit-eval-fn submit))))
I’m already talking with the author of Tutkain how I can get my hands on *out* and *err* , but assuming I get that done, what is the best way to forward those writers (?!) to Reveal?

vlaaad10:02:55

I mean, after connecting to tutkain repl, you could start a r/repl

Sam Ritchie20:02:40

Hello! I’m looking to build a demo “batteries included” for using #reveal with the #sicmutils computer algebra system, and was curious if anyone had extended reveal to allow rendering forms as LaTeX ?

Sam Ritchie20:02:59

for example, symbolic equations are renderable as • clojure data structures like (+ 'x 'lambda) • latex, like "x + \lambda" • infix strings, like x + λ

Sam Ritchie20:02:44

which is annoying in a normal REPL, where I can only access the data structure view. So I’d like to offer some plugin for reveal that says “render a Literal as a LaTeX form”, or extend reveal to make that possible

Sam Ritchie20:02:12

There are of course more types in the language that could benefit from custom LaTeX renderings, or maybe something more interesting. polynomials, rational functions, power series, etc

vlaaad21:02:19

Hey Sam! While the main output view in Reveal is monospace only, you can create different view based on JavaFX nodes, including web view

vlaaad21:02:39

There is an example that integrates vega view here: https://vlaaad.github.io/vega-in-reveal

🎉 1
Sam Ritchie23:02:37

Thanks, I'll give it a look!