Theasta

Techniques of The Professional PixPocket

There Is A Life Outside The IDE For Your JSDoc Comments

Applications that I really use on a daily basis can be counted on the fingers of one hand, one of them is an API Documentation Browser called Dash. Used in conjunction with Alfred, it lets you access and search docs in a heartbeat, even if you’re offline.
Wouldn’t that be great if you could also use it with your own projects? You actually can!

Searching Dash for "FileL" through Alfred

Here’s how to automatically generate a dash-compatible docset from your own code and JSDoc comments.

1
2
3
npm install jsdoc -g
npm install jsdoc-dash-template --save-dev
jsdoc -d path/to/output/folder -p -t node_modules/jsdoc-dash-template -r path/to/src/folder

Double-click on the docset to open it in Dash. Linux or Windows users may also take a shot at Zeal or Velocity.

Searching Dash for "ReactReconciler"

If you’re just curious about the final result, you can download the docset I created by running the tool directly on React source code. The generated documentation won’t look like the public API you can find on the official website since it also exposes the private methods. Very handy if you want to dive into React internals.

The original project, jsdoc-dash-template, is hosted on Github. The README file provides further documentation on how to fine-tune your docset by adding a custom icon or title. Feel free to log any issues you may encounter directly there.

Comments