Alternatives for literate ReScript?

I’d like to create some rich-text documents with images and mathematical symbols that have blocks of ReScript code which are evaluated and results shown at document render time. So some kind of literate ReScript.

I can see a few alternatives:

  • a notebook format like Observable ( which seems to support Javascript.

  • a markup format like Org, although that probably means using Emacs.

  • the same format that the ReScript API docs are written in?

Can anyone suggest a better approach?

We’re doing work on doc extraction that will eventually end up covering at least parts of what you’re talking about. There’s also the Playground that might serve as inspiration, if it’s render time evaluation you’re looking for.

As for right now, looking at what the official documentation does (although it’s at compile time) is probably the best bet.

Although Sketch has only Reason and OCaml syntax support (not ReScript syntax), it may be worth a look:

The process for the official documentation is very neat with the .mdx files. Now I think about it, it doesn’t really matter when code blocks are evaluated, so I’ll try some experiments with those tools.

That’s nice, thanks for the hint.

I also discovered Quarto documents: Quarto - Execution Options which I think would need some kind of adapter for running ReScript blocks.