Description of all the files in the github repository

(about researchr)

All files can be downloaded from github. Because I constantly change the files to suit my own workflow and experiments, and because this has grown quite organic, rather than being planned, it's a bit of a mishmash. This is an attempt at documenting which files do what, and show how it all “hangs together”.

I have attached links to the source in github, and also shown which keyboard shortcuts I have assigned the various scripts (see keyboard shortcuts). These have nothing to do with the programs themselves, of course, and can be freely assigned. Unless something else is indicated, my shortcuts start with CTRL+ALT+CMD to avoid conflicting with existing program shortcuts.

Also see my design patterns, where I have documented some neat ways of coding, and a list of the Appscript strings I have used.

BibDesk

Read more about BibDesk hacks in general

bibdesk-copy.rb src Copies all the selected publications onto the clipboard, in the format citekey, which are understood by DokuWiki and WordPress renders, as well as PanDoc. C
bibdesk-linkfile.rb src Automatically attaches the most recent PDF file in the Download directory to the currently selected publication L
bibdesk-qlook.rb src Launches quicklook to quickly preview currently selected file ALT+SPACE
bibdesk-kindle.rb src Reformats and sends the selected files to Kindle, either by copying, or through e-mail (if Kindle is not connected) K
bibdesk.rb src Opens selected citations from BibDesk in Chrome, creating metadata pages if they don't already exist CMD+E
bibdesk.app src App-wrapper for an AppleScript that launches bibdesk-url.rb, and is connected to the bibdesk: URL scheme
bibdesk-url.rb src Launched by a bibdesk: URL through bibdesk.app, opens the citation given in BibDesk
gscholar.rb src Looks up the title of the currently selected publication on Google Scholar, and displays a list of the top hits with PDFs available for download (for use with gscholar-y.rb) G
gscholar-y.rb src Takes a number argument, reads the file generated by gscholar.rb, downloads the correct file, and autolinks it to the selected publication 1..8

Skim

skim.rb src Exports all highlights, notes and images from open PDF file to wikipage, also generating citations (see anatomy of a publication page) CMD+E
skim-screenshots.rb src Adds path of most recent screenshot in Desktop folder to a temp file, used when skim.rb exports notes to wiki. First use Shift+CMD+2 or Shift+CMD+3 to take screenshot, then this to add to cache C
skimx.app src App-wrapper for an AppleScript that launches skim-url.rb, and is connected to the skimx: URL scheme
skim-url.rb src Launched by a skimx: URL through skimx.app, opens the PDF given in Skim (on the page given, if specified)

DokuWiki

Although these scripts are written to interact with DokuWiki, they interact directly with Chrome.

dokuwiki-bulletlist.rb src Converts the selected text to a DokuWiki bullet list, splitting on LF, comma, semicolon or space (trying to determine intelligently which one to use) P
dokuwiki-clip.rb src Asks for a page name, and appends selected text on current page to that wiki page, with proper citation I
dokuwiki-go.rb src Presents a wiki page selector and opens the selected page '
dokuwiki-image.rb src Moves the most recent screenshot to the DokuWiki media folder, and inserts a proper DokuWiki image tag C
dokuwiki-sbs.rb src Asks for the name of a page, and presents it side-by-side with the existing page, in editing mode if it's a wiki page, and run through Instapaper to clean it up, if it's a normal page :
newauthor.rb src Launched through a ruby: link in the DokuWiki sidebar, asks for the name of an author, and creates a new author page according to template. Wouldn't be necessary if 404redirect plugin enabled templates when opening a new file for editing automatically
sbibtex.php src Plugin for DokuWiki which renders citekey as Author, Author2 (year), linked to the main publication page, and shows the full citation on mouse-over. Gets its data from the json file generated by bibtex-batch.rb

Chrome

imfeelinglucky.rb src Script similar to gscholar.rb, searches for currently selected phrase in Google, gives you top hits, let's you choose one (through imfeelinglucky-y.rb) and then inserts a fully formatted links, depending on whether you are currently browsing a wikipage, WordPress, or any other page. Currently doesn't work, because Google blocked the API L
imfeelinglucky-y.rb src See above 1..4
ruby.app src App-wrapper for an AppleScript that launches ruby.rb, and is connected to the ruby: URL scheme
ruby.rb src Launches whatever ruby script was specified by a ruby: URL, through ruby.app, used for newauthor.rb

Kindle

kindle-mount.rb src Script that processes a My Documents.txt file from Kindle, and imports all clippings into DokuWiki (can be launched automatically on mount, see launchd)
kindle-mount.sh src Bash-script to run kindle-mount.rb, needed by launchd

Other apps

qlmanage-doc2pdf.rb src Uses quicklook to generate a PDF of Word doc, RTF etc currently selected in Finder P
devonthink.rb src Opens currently selected publication in DevonThink in DokuWiki (used for importing entire BibDesk PDF folder into DevonThink for full-text search CMD+E
convert-doc.rb src Takes a text file as argument, and converts it into HTML formatted for opening in Word, converting all citekeys into proper citations, and adding a reference list. Inspired by Pandoc, still very early days. Should eventually be able to output to different formats.

Utility scripts

bibtex-batch.rb src Runs through Bibliography.bib (generated by BibDesk) and generates main bibliography, bibliography pages by author and by keyword, and json bibliography cache for WordPress and DokuWiki plugins
utility-functions.rb src A number of useful functions used by other scripts, such as wrapper for growl, File.write and File.append, wrappers for pbcopy and pbpaste, clean_pagename (see below), GUI wikipage selector, wrapper for dwpage (insert page in DokuWiki), etc.
clean_id.php src Extracted from DokuWiki source code, takes a title and turns it into a DokuWiki filename (ü → ue etc). Used by clean_pagename() in utility-functions.rb
utf8.php src Helper script for clean_id.php, from DokuWiki source code
wiki-lib.rb src Functions for DokuWiki, mainly ensure_refpage() which generates the main publication page (see anatomy of a publication page)
mail-lib.rb src Helper function for e-mail, used by bibdesk-kindle.rb
config.yaml.distribution src Rename to config.yaml and modify, used by mail-lib.rb
update_refpage.rb src Command-line script to force updating of main publication page (citation info), usually ensure_refpage() only does this if file doesn't already exist
Pashua.rb src Helper script for using Pashua, GUI library used by wiki page selector
keyboard_maestro.kmmacros src Dump of Keyboard Maestro shortcuts, see keyboard shortcuts
wiki.sh src Bash-script using rsync to update server-version of DokuWiki. Updates all files, including plugins etc, and generates sitemap for Google
wikilite.sh src Version of wiki.sh that only updates data-files (not plugins and config), should usually be used

Legacy

These are scripts that I were working on, but are not part of the key researchr workflow, some of the code I still use, other I keep around in case I want to keep hacking on it.

convert.rb src Imports a Kindle My Clippings file to DevonThink
folders.rb src Converts a hierarchy of folders and files to a website with index, can process output of Scrivener and DevonThink “export to HTML
library.rb src Helper functions for folders.rb
amatch.rb src Experiment with matching Kindle clippings with PDFs in Skim, not functional
make-clippings-nice.rb src Tool to reformat some legacy clippings
testskim.rb src Related to amatch.rb
teststrip.rb src Related to amatch.rb
Print/export