Sublime Forum

Jquery & Dojo Quick api doc access plugin

#1

Hi everyone,

I started using ST2 a couple of weeks ago and I’m already in love with it. Since I don’t have the money at the moment (I’m ashamed to admit it) but I still haven’t bought a license, but I will as soon as I can. In the meantime I’m kinda interested in developing a plugin that will allow you to access Javascript API Documentation quickly. I’ll probably start with Jquery and Dojo, since those seem easily enough to hack the urls.

As an example, let’s say you have the following code:

$('body').html();
            ^

And you have the cursor anywhere inside the “html” part, with this plugin you could trigger a command and a new tab would pop open in the jquery doc of the html method (api.jquery.com/html/).

My question is: is there already a existent plugin with similar functionality? I did a quick search on the Package Manager and on the forums and I can’t find one. Also would this be useful for anyone out there?

Thanks :smile:

0 Likes

#2

Since trying is better than actually explaining, I did a draft script of the plugin:

github.com/skkeeper/OpenJsApi/zipball/develop

The commands provided are ‘open_js_api’ (for the official documentation) and ‘open_js_api_info’ (for the jsapi.info website), or you can just use CTRL + SHIFT + P and select “View Official JS API Documentation” or “View JSAPI.info API Documentation” while you have the cursor in one of the methods.

As I said this is just a initial hack to demonstrate the concept. Some feedback would be great :smile:

0 Likes

#3

Ok so I found Go To Documentation plugin pretty much replicates this functionality but doesn’t have specific support for Javascript libraries, I’m forking the project and adding the functionality. Hopefully the original author will accept the merge.

EDIT: In the meantine my fork is available here for testing: github.com/skkeeper/sublime-tex … umentation

0 Likes