3 ms·
Do you have an example that shows this? I'm interested in bringing something like that into my own site.
by 0xCMP 10y ago
Do you have an example that shows this? I'm interested in bringing something like that into my own site.
- chriswarbo 10y agoI wrote it up at http://chriswarbo.net/projects/activecode http://chriswarbo.net/projects/activecode The process I use is very simple: shell commands are written as attributes of code blocks, and during rendering the content of the code blocks will be piped into those commands. Hence we can run a bash script by giving its code block a pipe="bash" attribute, python scripts by using pipe="python", haskell by using pipe="runhaskell", and so on for anything that can be called from a shell. This is all powered by a couple of scripts based on Pandoc. If you want to see some examples, click the "View Source" links at the bottom of my site. The pages I linked to above are quite complex, but some simpler examples are: - The blog post listing comes from a `find` command http://chriswarbo.net/blog.html http://chriswarbo.net/blog.html - Images can be embedded using base64 URIs http://chriswarbo.net/blog/2015-06-06-more_git.html http://chriswarbo.net/blog/2015-06-06-more_git.html - Code snippets can be checked, and we can even include real error messages http://chriswarbo.net/blog/2015-11-12-calculating_arity.html http://chriswarbo.net/blog/2015-11-12-calculating_arity.html