Literate programming mode?


Just want to say I’ve been keeping an eyeball on this since it was called d3-express, I’m really excited by this project (as are a couple of the folks at Starcount).

I have a suggestion, would it be possible/feasible/desirable to have a literate programming mode for creating the notebooks? This link gives some context:

When I tried to create a new notebook, I was trying to insert text into the line much like I would with a rich text editor, and trying to select lines to delete. I got stuck on a syntax error with removing the closing tick on a piece of markdown.

Wanted to throw it out there. So glad you’ve made this tool available, I’ll be giving it a good spin this weekend.

1 Like

Also, will there be a private notebooks option a la GitHub? I would pay for that.

Sure! We’re strongly considering different cell types in the future, so that it isn’t necessary to escape all the backticks in Markdown and double-escape the \ in tex literals. For now though, the pattern is more that instead of using indentation to separate prose and code like you would do in literate coffeescript (or > in literate haskell, etc), you use different cells - throw Markdown cells before & after important blocks of code. For instance, I recently ported this literate raytracer from literate JavaScript (and docco) to this Observable notebook, mainly by splitting the indented prose blocks into cells of their own.

And, yep, I can’t make any promises re: roadmap, but private notebooks are high on our list.

Thanks Tom. Just gave me an idea, is there a tool that can convert a literate file into cells that can be published to a notebook, or an API interface to publish notebooks?

1 Like