Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to dox unrecognized context formats #156

Open
trusktr opened this issue Feb 26, 2015 · 1 comment
Open

How to dox unrecognized context formats #156

trusktr opened this issue Feb 26, 2015 · 1 comment

Comments

@trusktr
Copy link
Contributor

trusktr commented Feb 26, 2015

For example, I have something like

import _ from 'underscore';
import template from 'header.hbs';
import ViewBase from 'ViewBase';

/**
 * @class Header
 * @extends {ViewBase}
 */
export default
class Header extends ViewBase {

  /*
   * Method documentation.
   */
  someMethod() {
    // ...
  }
}

// Other stuff to document for the Header class, using underscore to extend the prototype.
_(Header.prototype).extend({

  /*
   * @property {Function} template A handlebars template function.
   */
  template: template
});

As you can see there, I'm using the changes in PR #143 to document my class, but then I also need to document the properties I'm adding to the prototype in the following block (since ES6 classes don't allow properties to be added directly onto the prototype).

The way dox works, it'll still pick up this comment, but it might not know it's constructor/class, and the underscore _() syntax for extending the prototype isn't extended.

So, generally speaking, any ideas/suggestions on how we might be able to handle custom styles of code and associate them to constructors/classes, in a generic way? Maybe custom tags like @parentclass or @parentconstructor specifying the name of the parent constructor/class context? f.e.

/*
 * @parentclass Header
 */
_(Header.prototype).extend({

  /*
   * @property {Function} template A handlebars template function.
   */
  template: template
});

That's just an idea. Seems like a lot more thought is needed.

@Twipped
Copy link
Collaborator

Twipped commented Mar 18, 2015

I think this is the concern that PR #85 was attempting to address with support for @lends. That PR wasn't mergable any more, but I'll look into adding support myself.

In general I think dox needs to support more implicit context values from tags.

I'll leave this issue open for now until I've had a chance to consider options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants