Interactive MarkDown
A file format specification for notebooks
The specification
Normal markdown for most
Code blocks have their particularities
They use triple backticks and language tags for syntax highlighting
``js
console.log("yo")
``
Continuation
They use triple dots to signify continuation
``js
let myFunction = x => y => {
...
``
Some explication about currying...
``js
return x*y + x/y
}
console.log(myFunction(3, 5))
``
Interactive core
The interactive core for js
would be called for the whole function definition and application
To make the code blocks interactive, some metadata is used to link a language to a js script
---
js: ./cores/js-core.js
rust: ./cores/rust-core.js
---
Those cores take strings as inputs and outputs to the notebook via a logger
// Very dumb Deno js example of such core script
let core = (string: input => void): logger) => (string: code) => {
let filename = `./tmp/${Date.now()}.js`
Fs.createFile(filename, code)
let output = Deno.cli.run(`deno run ${filename}`)
logger(output)
}