mbutterick / pollen-users

please use https://forums.matthewbutterick.com/c/typesetting/ instead
https://forums.matthewbutterick.com/c/typesetting/
52 stars 0 forks source link

Interactive books with Pollen? #37

Open jenshweber opened 4 years ago

jenshweber commented 4 years ago

Hello, I just read through the Pollen information and I am wondering if Pollen is capable of creating interactive electronic books. I do understand (of course) that the underlying Racket system can do anything. However, I am wondering whether Pollen supports interactive books (i.e., books that allow readers to enter data that will then be processed by some Racket function and result in an update of the displayed page content.)

sorawee commented 4 years ago

I assume that you are targeting HTML. In that case, the "interactive" part requires JavaScript. You could either write JavaScript directly, use RacketScript (which allows you to write Racket, and it will translate the Racket code to JavaScript), or use Urlang (which allows you to create JavaScript syntax tree from Racket side).

Here's an example of my Pollen project that is "interactive". It allows users to step through program evaluation back and forth. Here's the JavaScript file.