Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

This is an MIT-licensed jsdoc-toolkit 2 template that produces ReStructured Text (*.rst) with Sphinx directives. Makes it easy to document Javascript in Sphinx projects.

branch: master
README
This is an MIT-licensed jsdoc-toolkit 2 template that produces ReStructured Text (*.rst) with Sphinx directives. This template makes it easy to document Javascript in Sphinx projects. For more information about the JSDoc syntax, see http://en.wikipedia.org/wiki/JSDoc and http://code.google.com/p/jsdoc-toolkit/wiki/TagReference.

Installation: it's easiest if you just include this template alongside your Sphinx themes. You'll also need a working jsdoc-toolkit install. Then do: 

	java -jar /path/to/jsdoc-toolkit/jsrun.jar /path/to/jsdoc-toolkit/app/run.js ./ --template=doc/_themes/jsdoc-for-sphinx -x=js,jsx --directory=./doc/jsdoc

This will place a bunch of automatically generated RST docs in the ./doc/jsdoc directory.

Within your Sphinx templates, simply include the generated javascript documentation using the include directive. You can control which parts of the documentation you want to include using the start-after option. The generated docs each contain references called class-title, class-properties and class-methods. So, for example, if you just want to include the autogenerated methods, you'd do: 

.. include:: jsdoc/MyJavascriptClass.rst
   :start-after: class-methods

It's a bit clunky, it's not perfect, but it's the closest thing to sphinx.ext.autodoc for Javascript, and it gives you all that Sphinxy goodness you've learned to love.

(Note to forkers: only the class.tmpl template file is currently in use.)
Something went wrong with that request. Please try again.