This is a simple bash script that takes a markdown
.md document and publishes it directly to your blot folder. If you don’t have citations in your post, there is less of a need to run this script. However, blot doesn’t convert markdown to html perfectly and so this script means you can use the full wealth of pandoc’s markdown conversion abilities and set proper HTML before dumping it into your blot folder for publications.
Download the script from github
It needs a little preparation.
- open the script in a script editor such as atom or xCode
- setup the path to your blot directory, mine is here, yours is probably the same:
- setup the path to your
.cslstyle document (how pandoc makes your citations look)
- similarly setup the path to your .bib file
When you’ve done that, save the script somewhere sensible.
The script assumes that you’re already using
pandoc-citeproc to render useful documents from markdown.
- a pucker .bib file (made with
zoteroor something) https://www.zotero.org/download/
- a bib csl style, download from here: https://www.zotero.org/styles/
- something nice to write markdown with, atom is lovely: https://atom.io/
realpathavailable in the OSX core utils from brew
brew install coreutils
rsyncto enable flawless updates from your source directory
brew install rsync
bash /path/to/script/p2b.sh inFileName.md '[subfolder]/[subsubfolder]'
bash ~/Dropbox/shellScripts/p2b.sh example.md '[teaching]/[soundtracks for screen]'
The script will copy an
videos folder across to the relative directory in blot. If you have other things like
files this goes to the root directory instead. Any images you refer to in your canonical document will be copied across. Bear in mind however that if you don’t place an _ (underscore) in front of image names, they will be published as blog posts as well. I have taken to naming my files thus:
Have fun.., oh and here’s some citations to be sure that the script is working properly for this post. Notice, that in markdown, I’ve added a final section
#References. Citations will show up underneath this (Parker, 2018), (MacFarlane, 2019), (Smalley, 1994).
MacFarlane, J. (2019). Universal markup converter. Contribute to jgm/pandoc development by creating an account on GitHub. https://github.com/jgm/pandoc
Parker, M. (2018). Sonikebana, version 1.0 documentation example. Sonikebana V1.0. https://doi.org/https://doi.org/10.7488/ds/2351
Smalley, D. (1994). Defining timbre Refining timbre. Contemp. Music Rev., 10(2), 35–48. https://doi.org/10.1080/07494469400640281