Zettelkasten in Sublime (a note on Dan Sheffler’s script)

I’ve rapidly become a huge fan of Dan Sheffler’s workflow. One thing that I’m really looking forward to trying out is is ‘Zettelkasten‘(also here), a kind of flat wiki-like approach to note taking. I have always struggled with effective notetaking, but combining his markdown export from pdfs (via Skim) with the zettelkasten (which I could then push to github for open-notebooking purposes, or feed to Jekyll, or text mining, etc) has me (geek that I am) rather excited about the prospects.

Anyway, I’ve just gotten everything working. Here’s how:

1. Install Sublime Text 3.
2. Download the MyWiki zip from Dan’s repo on Github.
3. Install Package Control from packagecontrol.io

3a (because I forget this step when I first published this post: Install Bracketeer plugin; go to preferences – package control – install packages – type in ‘bracketeer’, select it, hit enter).
4. Open Sublime Text 3.
5. Under Preferences, go to ‘browse packages’. This opens the package location in your finder.
6. Meanwhile, unzip the MyWiki plugin. Copy the MyWiki folder to the package location.

I had trouble getting Sublime 3 to recognize the ‘keymap’, that is, the file telling Sublime what keys fire up what commands in the MyWiki.py file. I renamed it to ‘Default (OSX).sublime-keymap’ which should’ve solved the problem, but didn’t.

7. So instead, I went to Preferences – key bindings – user, and copied the text of Dan’s file into this default one.
8. In the file ‘MyWiki.sublime-settings’ I changed the wiki_directory like so:

“wiki_directory”: “/Users/shawngraham/Documents/notes-experiment-sublime/”,

I saved everything, restarted sublime text, and voila!

Screen Shot 2015-07-01 at 3.52.10 PM
Hard to see it, but I’ve just typed [[ in a markdown document, and an autocomplete with all of the file names (that is, notecards) appears so that I can ensure consistency across my files or create a new note.

Exporting your PDF Annotations from Skim

I’ve got to write this down now, while I still remember what I did. Dan Sheffler has a great blog. Lots of really neat & useful stuff. One of the things he has is a script for exporting your notes and annotations of pdfs in nicely formatted markdown. (All OS, I’m afraid Windows folks). First two things we need: Skim: http://skim-app.sourceforge.net/ Bibdesk: http://bibdesk.sourceforge.net/ And a pdf of some academic article. Download and install Bibdesk. Open Bibdesk. Drag & drop your pdf onto the Bibdesk window. Add relevant metadata. Crucial: the ‘Cite key’ field is like a shortcode for referencing all this. Screen Shot 2015-06-28 at 9.56.16 PM In the screenshot above, I’ve got Alice Watterson’s recent piece from Open Archaeology. My cite key is her name & the year. Now, in Skim, open that pdf up, and start making notes all over it. Save. Now, the first thing we’re going to do is use Sheffler’s script for making custom URLs that will link our notes to the relevant page of the pdf; these are URLs that we can then use in our Markdown documents. His instructions are at: http://www.dansheffler.com/blog/2014-07-02-custom-skim-urls/ To follow those instructions, find your AppleScript editor on your machine, and paste his code in. Save as an application. Then, find the application (he called his ‘Skimmer’) on your machine, and right click (or whatever you do to bring up the contextual menu) and inspect package contents. You then open the info.plist file in a text editor, and swap the default for what Sheffler instructs – see my screenshot:Screen Shot 2015-06-28 at 10.00.24 PM Run the Skimmer application. If all goes well, nothing much should appear to happen. Ok, so, let’s test this out. I went to dillinger.io and made the following md link: [@Watterson2015 [page 120](sk://Watterson2015#120)] and then exported it as html. I opened the html in my browser, and hey presto! When I clicked on the link, it opened the pdf in Skim at my note!

So that’s part 1 achieved. Now onwards to part 2.

Next, we want to export our Skim annotations as nicely formatted markdown (you could then use them in a blog post, or on github, or wherever). http://www.dansheffler.com/blog/2014-07-07-exporting-skim-notes/ Again, open up your applescript editor, and paste Sheffler’s code. This code requires that you have those custom URLs set up, BibDesk installed, and something called pdftk (I checked it out; seems to be a windows program, so I ignored it. Script ran well anyway, so *shrug*) [1]. Finally, the end of the script opens up Marked for viewing and editing the md. I don’t have that, so I simply changed that final line from Marked to Atom (which I do have) – and that works. If you right-click on your finder, select ‘go to folder’ and type in Library, you can find the ‘Application\Support’ folder. I made a new subfolder called ‘Skim\scripts’ and saved the script in there as skim-export. Fired Skim back up, opened Watterson 2015 in Skim, selected ‘skim-export’ and behold: Screen Shot 2015-06-28 at 10.11.59 PMA nicely formatted markdown document with my annotations – and crucially, the links back to the original pages. I can now save this markdown into a github repo, or any number of markdown flavoured wiki type things that run locally on this machine, or use pandoc to convert it to something else, or… Markdown is *wonderful*. These scripts are too! Thank you Dan. Next thing I want to try: http://www.dansheffler.com/blog/2015-05-11-my-zettelkasten-in-sublime/

[1] Dan responds at http://dansheffler.com/blog/2015-07-01-electric-archaeology/ to note that the tool in question is here: https://www.pdflabs.com/tools/pdftk-server/ and runs on the command line.