Emacs evaluating code in Weave / jmd files?

I’m writing documents using Weave, which is working great. Of course, I can easily with a single command, convert my document to a Notebook:

notebook("...");

However, I work in Emacs, and it’d be great to be able to move into a code block and press some magic key combo and send that code block to a Julia REPL buffer. Is that possible? What Emacs packages are required?

EDIT: it looks like with the julia-repl package, julia-repl-mode can operate as a minor mode from within the markdown major mode and send regions to the julia REPL… Is this more or less the recommended method?

2 Likes

This does not answer your question, but I find the workflow with

very nice and Emacs-friendly (it is just code with comments).

2 Likes

If you’re working with Weave, jmd files, then emacs poly-markdown mode + julia-repl is pretty sweet. When you enter a code block, it looks at the

```julia

And realizes it’s a julia block and puts that portion of the buffer in julia mode where you get syntax highlighting and soforth. Then you can mark a region and C-c C-c to have julia-repl send it to a repl buffer. That fits my work pattern pretty well.

Literate seems like a decent alternative, but it doesn’t seem to fit my use case as well, where a lot of what I’m doing is writing english language text with links and markdown formatting, and then interspersing code blocks.

3 Likes