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

Generate jsdocs #5824

Merged
merged 1 commit into from
Nov 8, 2019
Merged

Generate jsdocs #5824

merged 1 commit into from
Nov 8, 2019

Conversation

benmccann
Copy link
Contributor

@benmccann benmccann commented Nov 11, 2018

Closes #5821

This PR generates jsdocs that we can link to from the docs to add missing docs as suggested by @jukra

@etimberg
Copy link
Member

If we generate JSDocs, should we serve them from somewhere?

@benmccann
Copy link
Contributor Author

@etimberg Yes, good idea. I added them to the left nav menu (SUMMARY.md)

@kurkle
Copy link
Member

kurkle commented Jan 1, 2019

I wanted to see how these look like. To build, I changed docsTask to following:

function docsTask(done) {
  var bin = 'gitbook-cli/bin/gitbook.js';
  var cmd = argv.watch ? 'serve' : 'build';

  return run(bin, ['install', './'])
    .then(() => run(bin, [cmd, './', './dist/docs']))
    .then(() => {
      var config = {
        opts: {
          destination: './dist/docs/jsdoc'
        },
        recurse: true
      };
      gulp.src(['./src/**/*.js'], {read: false})
        .pipe(jsdoc(config, done));
    }).catch((err) => {
      done(new Error(err.stdout || err));
    });
}

And here's a example page from the generated docs (printed as pdf to be attachable here):
Documentation Interface_ IPlugin.pdf

A lot of documentation is missing from code to build releaseable documentation.
So I think generation should be limited to the stuff that is readily documented in the code (like this plugin interface).

I think helpers would be a good candidate for documenting and generating next.

@benmccann
Copy link
Contributor Author

Thanks @kurkle. I've rebased against master using the code you provided

I'm not sure that it's an issue to generate jsdocs for APIs that don't have much documentation yet because I think it may spur contributors to help fill in the missing docs

@kurkle
Copy link
Member

kurkle commented Nov 8, 2019

Should we go ahead and try this out?

@etimberg
Copy link
Member

etimberg commented Nov 8, 2019

Am happy to try these out

@etimberg etimberg added this to the Version 3.0 milestone Nov 8, 2019
@etimberg etimberg merged commit 3a33793 into chartjs:master Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants