0

I'm looking to extend jsdoc (particularly with docstrap). I have a nodeJS application and want to split the jsdoc navigation to Controllers, Views ,etc. I've managed up to a certain extent with this by creating my custom tags such as @controller and managed to get it to be capturaed by JsDoc similar to @module so it generates the page (with description) . However my issue is when it comes to the functions associated with for example the controller which are located with a 'module.exports' function. The documentation generated basically ignores any other functions in that @controller file. How can i capture these function.

Below is an example of this:

/**
 * @controller my_controller
 */
module.exports = {
    /**
     * @description my function
     */
    myFn : function(){

    }
}
user584569
  • 155
  • 10
  • so far the only way i have gotten this to work is by using the `@memberof controller:my_controller` . any other options? – user584569 May 11 '15 at 06:02

1 Answers1

0

What has worked for me in a similar context is to use a plugin which effectively tags the element as a module when it is tagged as controller. That way you get the module-like behaviour and then when rendering the modules you simply exclude the models, view and controllers.

I have to patch a lot of places to get it to work otherwise as some behaviours are simply bound to modules and there is no abstraction on top which would allow you to trigger the same behaviours.

SGD
  • 1,601
  • 12
  • 18