Convert Pandoc Temp Citations back to Bookends Scannable Temp Citations.

Users asking other users for AppleScripts that work with Bookends.
Post Reply
iandol
Posts: 465
Joined: Fri Jan 25, 2008 2:31 pm

Convert Pandoc Temp Citations back to Bookends Scannable Temp Citations.

Post by iandol »

Most of my workflows use Pandoc to generate my bibliographies, and so my default temporary citation format is [@user1; @user1]. Bookends cannot scan a document that contains this kind of temporary reference, so I wrote a small script that converts them back into a format Bookends can scan: {user1; user1} — this currently works on plain text files (should be able to parse markdown, text, RTF etc.; I was thinking to add in a away to scan Word docs too, it is a zipped XML file after all but haven't done it yet...). This also allows you to specify a group name and it will add all the scanned references into a new group in Bookends (new feature added by Jon recently!)

Code: Select all

convertRefs.rb MyDoc.md NewGroupName
Will output a convert_MyDoc.md in the same folder and add the refs to NewGroupName. If you omit the groupname no group will be created.

Find the code here: https://github.com/iandol/dotfiles/blob ... ertRefs.rb
Post Reply