tinparkBlog |||

p2b.sh (#pushToBlot)

goToBlot

Download the script from github

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 no real need to run this script. However, if you do want to include citations in blog posts and while David at Blot works out whether it’s worthwhile adding a feature to directly parse citations in md to the .html that renders on .blot sites, this script should keep you sweet.

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:
    • ~/Dropbox/Apps/Blot
  • setup the path to your .csl style document (how pandoc makes your citations look)
    • e.g. cslPath=~/Dropbox/bibliography/journal-of-new-music-research.csl
  • similarly setup the path to your .bib file
    • e.g. ~/Dropbox/bibliography/bibliography.bib

When you’ve done that, save the script somewhere sensible.

The script assumes that you’re already using pandoc and pandoc-citeproc to render useful documents from markdown.

dependencies

  • pandoc http://www.pandoc.org/
  • pandoc-citeproc https://github.com/jgm/pandoc-citeproc
  • a pucker .bib file (made with zotero or 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/

usage example

  • cd to/the/directory/with/your/markdown
  • bash /path/to/script/p2b.sh inFileName.md
  • eg: bash ~/Dropbox/shellScripts/p2b.sh example.md

note

The script will look for an images folder and a files folder, if there is one where your .md is, it will copy the contents to corresponding folders in your .blot directory. This means 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: _image.png.

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 (2006–2016), Smalley (1997))

References

MacFarlane, J. (2006–2016). Pandoc. Retrieved from http://pandoc.org/

Parker, M. (2018). Sonikebana, version 1.0 documentation example. https://doi.org/http://dx.doi.org/10.7488/ds/2351

Smalley, D. (1997). Spectromorphology: Explaining sound-shapes. Organised Sound, 2(2), 107–126. https://doi.org/10.1017/S1355771897009059

Up next some examples mpAmbiDecoder
Latest posts Output name: Journeyman Sonikebana Mezzanine mpAmbiDecoder p2b.sh (#pushToBlot) some examples instructions - academic writing in markdown