documentation/test/normalize.js
Tom MacWright 49347c82e7 Arv document exported (#502)
* Add a flag to document all exported bindings

This adds a boolean flag called `document-exported` (defaults to false)
that effectively adds an empty comment to all exported bindings that do
not already have a JSDoc comment. It also does the same for the
members of exported classes and objects.

```js
export class C {
  method() {}
}
```

Both `C` and `C#method` are now part of the generated documentation.

Related to #424

* Fix lint error

* Rebase and use options pragma in test file

* Create extractor type as a generalized comment/export getter

* Document exported extractor
2016-08-24 10:58:15 -04:00

18 lines
401 B
JavaScript

var walk = require('../lib/walk');
module.exports = function (comments) {
return walk(comments, function (comment) {
var hasGithub = !!comment.context.github;
var path = comment.context.path;
comment.context = {
loc: comment.context.loc
};
if (hasGithub) {
comment.context.github = '[github]';
}
if (path) {
comment.context.path = path;
}
});
};