Dojo js library + jsdoc & # 8594; How to document the code?

I would like to ask you, how dojo guys create documentation?

From nightly compilations you can get uncompressed js files with all the comments, and I am sure that there is some documentary documentation for the script that will output some html or xml from it.

I assume they use jsdoc, as it can be found in the utils folder, but I have no idea how to use it. The jsDoc toolkit uses different notations /**commenting**/ than the original dojo files.

thank you for your help

+6
dojo documentation-generation
source share
2 answers

All this is done using the PHP and Drupal proprietary parser. If you look at util/docscripts/README and util/jsdoc/INSTALL , you can get all the details on how to generate documents.

It is different from jsdoc-toolkit or JSDoc (as you opened).

FWIW, I use jsdoc-toolkit as it is much easier to create static HTML and there is a lot of documentation about tags on google code page.

Also, to be clear, I myself do not develop a dojo. I just use it a lot at work.

+4
source share

The dojo jsdoc "process consists of two parts. There is a parser written in PHP that generates xml and / or json from the entire namespace listed (defined in util / docscripts / modules, so you can add your own namespaces. At the top of the file "generate" has basic usage instructions. php ") and a part of Drupal called jsdoc that installs as the drupal / plugin / whatever module.

The Drupal Aspect is simply a Dojo basic view of this data. A well-designed XSLT or something to iterate over json and produce html will work the same way, although none of them are provided by default (like the contribution!). I shy away from the Drupal bit, although it has been running api.dojotoolkit.org for some time now.

The doc parser is exposed, so you can use its validation features to write your own custom output. I use it to generate Komodo.cix code in the [pretty sloppy] PHP util / docscripts / makeCix.php PHP file, which uploads the information found in an XML document created to meet the specification. This could be changed to generate any output you selected, with a small number of finalists.

The doc syntax is defined on the style guide page: http://dojotoolkit.org/reference-guide/developer/styleguide.html

+4
source share

All Articles