A feature that I've been thinking about for a while is executable code blocks. That is, add s block like
var x=2+3;
print x;
And have "5" output in the blog. (Adding variable input, to get input
tags is an obvious extension).
I can think of a few questions:
- Where should the code run (client or server)
- What language(s) to handle
- How much access to the environment should the code have
- Are all the blocks in one post connected
- Are all the blocks in the blog connected
- How are errors handled
- What does securely look like
I've probably missed some.
A simple solution is raw JavaScript running in the browser. JavaScript doesn't have much of an isolation story, so all the code on the same page (i.e., all the code in the blog) world run in the same context.
Client side JavaScript would be easy to implement, assuming that I can convince Markdig to output script tags at the right time.
JavaScript is a little verbose, and therefore irritating to enter in a phone keyboard.
A bit more complicated would be Lisp, or an implementation of Mal. The same code could run either client or server side, it would only have access to the environment that I gave it (Unlike JavaScript, which would have access to the browser on the client), and it would encourage me to learn Lisp.
I'd need to write a JavaScript implementation (oh noes!), and again, make sure that I could get Markdig to cooperate, but it's an intriguing idea