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

Proper documentation generation #30

Open
SemenchenkoVitaliy opened this issue Jan 23, 2019 · 0 comments
Open

Proper documentation generation #30

SemenchenkoVitaliy opened this issue Jan 23, 2019 · 0 comments

Comments

@SemenchenkoVitaliy
Copy link
Member

SemenchenkoVitaliy commented Jan 23, 2019

If file has some class and function that returns an instance of this class then it should export not only function but also class itself. Otherwise, metadoc won't be able to generate documentation for this class. And documentation should be generated because it will be confusing to have docs for the function that returns the class instance but don't have documentation for that class. For example:

// Class description
class SomeClass {

  // constructor description
  constructor() {}

  // Method description
  method() {}
}

// Get SomeClass instance
// Returns: <SomeClass>
const getSomeClassInstance = () => new SomeClass();

module.exports = { getSomeClassInstance };

/cc @tshemsedinov @belochub @nechaido @lundibundi

Edit: Examples can be found here:

metasync
https://github.com/metarhia/metasync/blob/master/lib/chain.js
https://github.com/metarhia/metasync/blob/master/lib/collector.class.js
https://github.com/metarhia/metasync/blob/master/lib/collector.functor.js
https://github.com/metarhia/metasync/blob/master/lib/collector.js
https://github.com/metarhia/metasync/blob/master/lib/composition.js
https://github.com/metarhia/metasync/blob/master/lib/memoize.js
https://github.com/metarhia/metasync/blob/master/lib/queue.js

common
https://github.com/metarhia/common/blob/master/lib/cache.js
https://github.com/metarhia/common/blob/master/lib/events.js
https://github.com/metarhia/common/blob/master/lib/iterator.js

metaschema
https://github.com/metarhia/metaschema/blob/master/lib/schema.js

metalog
https://github.com/metarhia/metalog/blob/master/metalog.js

@belochub belochub transferred this issue from metarhia/metadoc Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant