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

Support doc blocks without leading asterisk #164

Open
chriskrycho opened this issue Feb 19, 2016 · 1 comment
Open

Support doc blocks without leading asterisk #164

chriskrycho opened this issue Feb 19, 2016 · 1 comment

Comments

@chriskrycho
Copy link

There are two common styles of doc blocks in JS these days. The first is the one currently supported by docblockr:

/**
 * This is the current style.

 * @param foo Does a fun thing.
 * @return The result of this function.
 */
function bar(foo) {
   // ...
}

Another style seems increasingly common, however, and I very much prefer it:

/**
  This is the style used in e.g. Ember.js' docs.

  @param foo Does a fun thing.
  @return The result of this function
 */
function bar(foo) {
  // ...
}

I'd love to see support for this style, without the leading asterisks on every line. (If you point me to the relevant spot in the code, I'll even take a look at what it would take to add a setting for it.)

@MoritzKn
Copy link
Collaborator

At least I can point you to the code:
The star is added in the DocBlockrAtom.prototype.create_snippet function in docblockr-worker.js L995.

Some Explanation:

  • this.prefix is "*"
  • out is an array with the lines. For example it could be ['@param {number} x','@return']
  • snippet contains the comment which will be added

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