|
|
|
|
|
by apenguin
4260 days ago
|
|
I love the idea of Literate Programming, and moreover pandoc is one of my absolute favorite tools. As such, I find this very interesting. However, I take issue with your complaint about Emacs being so huge -- pandoc is right up there, too (134 vs 89MiB on my system). Not to mention its seemingly endless stream of dependencies (50 packages according to my manager), as well as GHC which is over 700MB on its own. If you work with Haskell, this might not be too big of a deal, but otherwise you might need all this for pandoc alone. This is actually an issue for me with my tiny laptop SSD (this ends up consuming more than 5% of my root partition) -- I'm always debating removing pandoc, but never do because it's just such a great tool. |
|
The scripts I've written (PanPipe and PanHandle) require a Haskell implementation and the Pandoc library in order to be compiled or interpreted. Once they're compiled with GHC, they're completely standalone.
My plan is to have my server recompile my site when changes are pushed to Git. I like having Emacs, GHC, etc. on my laptop, but not on my server.
I actually tried to integrate Babel with Hakyll originally, but hit a bunch of problems. I didn't include that in the page since I thought it would be distracting. Most of it boils down to Org-mode's HTML exporter being awkward to invoke as part of a UNIX pipeline:
- Emacs can't handle stdio
- Org-mode has breaking changes between the version bundled in the latest stable Emacs (24.3) and that in ELPA (which I use)
- Syntax highlighting depends on the current Emacs theme
- Whole HTML pages are generated, which makes templating harder
- Anything which uses the filesystem leaves artifacts around
I did manage to hack together a shell script which created and switched to a temporary directory, saved /dev/stdin to a file, opened Emacs in batch mode, loaded Org-mode, opened the temp file, tangled the file, exported the file, exited Emacs, ran the result through some XSLT transformations and Python scripts to extract the data needed for templating, spliced the results through the templates, spat the result to /dev/stdout, switched out of the temp directory then deleted it. Needless to say, it was very fragile, and much more complex than writing these Pandoc filters!