#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2002
    Posts
    39
    Rep Power
    12

    Question creating javadoc output from javascript files


    i've never seen this done before, and a search has proved fruitless, but does anyone know how to create javadoc output from javascript files?
    all our js files are commented correctly but javadoc just doesn't seem to like it.....
    any help really appreciated!
    Duncan
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Posts
    6
    Rep Power
    0

    Auto-documenting Javascript files


    I discovered on the weekend that you can 'fool' phpDocumentor into parsing a js file.

    First you need to add the js extension to the phpDocumentor.ini file (under the [_phpDocumentor_phpfile_exts] tag). Then you need to add the following line to the top of your .js files:
    // <?php

    It won't parse the JavaScript classes (particularly with private functions) but will assemble all the public functions.

    Not perfect but it's a start. I'll see if I can nut out a way to at least parse out embedded class methods and properties.

    Regards,
    Andrew
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Posts
    1
    Rep Power
    0

    A free parser is available from SourceForge


    You can find a free javadoc-style parser for JavaScript files at http://sourceforge.net/projects/jsdoc. It requires Perl (as well as the HTML::Template module), which are all freely avialable. The idea of the parser is to handle (prototype-based) Object-Oriented JavaScript files almost exactly as Javadoc, including creating an index, showing inheritance, etc. Keep in mind that this is beta-version software, so there may still be some bugs (if you find any, please contact me at gab_reid@users.sourceforge.net). Support for general public functions and other features will be coming soon.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2002
    Posts
    39
    Rep Power
    12
    thanks both of you for your very helpful posts....
    i'm going to go away and try out both of these suggestions, and post back depending on my success!
    thanks again people
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Posts
    6
    Rep Power
    0

    JSDoc


    Thanks Gabriel. Will check out your project. Why I didn't think to do a search for javadoc and javascript on SF myself is beyond me

    Doh!

    Regards,
    Andrew

IMN logo majestic logo threadwatch logo seochat tools logo