Skip to content

Override detected code with jsdoc directives? #179

@trusktr

Description

@trusktr

It's been a while, but I'll be coming back to dox!

Question: does dox look at the comments when it can't infer from the code? Can we make it prioritize the comments over the code?

For example, I have

/**
 * This is the HTML entry point. This is what fires the app running.
 *
 * @class app
 *
 * @example
 * <app />
 */
angular.module('app').directive('app', function() {
  return {
    template: require('./app.html'),
    restrict: 'E', // custom element only, not attribute directive.
    scope: {}, // use isolate scope for custom elements.
    transclude: false, // if true, means the custom element can have children. Place the children anywhere inside the template using ng-transclude.
    controller: AppCtrl,
    controllerAs: 'app',
    bindToController: true, // always bind to controller with isolate-scope element directives.
  };
});

Since Angular directives aren't a standard JS thing, I thought I'd just use the @class jsdoc directive to document it (in Angular 2 they are classes anyways). I'm using dox 0.8.1 in dox-foundation, but the class docs don't show up. For example, here's what an actual ES6 class doc looks like in dox-foundation:

screen shot 2016-05-15 at 7 16 44 pm

But, here's what happens with the above sample code:

screen shot 2016-05-15 at 7 17 22 pm

which leads me to believe that the JSON that dox returns to dox-foundation is different in that case, which is why dox-foundation renders it differently. Is there (maybe we can add) an option to prioritize comments over code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions