TextMate Drupal API Lookup


Looking for the ability to quicky reference Drupal functions from TextMate? No problem! Simply add the following bash script into a command named as 'Drupal API Lookup', give it a key combination and choose output to show HTML. Then simply place the caret over the function you wish to lookup and press the corresponding key combination.

CORE=6
WORD=${TM_CURRENT_WORD}
URI="http://api.drupal.org/api/function/${WORD}/${CORE}"

exit_show_html "<meta http-equiv='Refresh' content='0;URL=$URI'>;"

Comments

Great snippet! Thanks!

Modified it do a search instead:

CORE=6
WORD=${TM_CURRENT_WORD}
URI="http://api.drupal.org/api/search/${CORE}/${WORD}"

exit_show_html "<meta http-equiv='Refresh' content='0;URL=$URI'>;"