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 should --polyglot mode control file extensions? #702

Closed
ikokostya opened this issue Mar 26, 2017 · 3 comments
Closed

How should --polyglot mode control file extensions? #702

ikokostya opened this issue Mar 26, 2017 · 3 comments
Labels

Comments

@ikokostya
Copy link
Contributor

ikokostya commented Mar 26, 2017

After upgrade from 4.0.0-beta.17 to 4.0.0-beta.18 documentation for C++ nodejs addon is not generated anymore. For generating I use the following command:

node_modules/.bin/documentation build src -o build_doc.json --polyglot --format json --github

where src is a directory with C++ code, e.g.

// src/test.cpp

/**
 * @function foo
 */
NAN_METHOD(foo)
{
}
@tmcw
Copy link
Member

tmcw commented Mar 31, 2017

Thanks for the report. I'll be looking into this on Tuesday - most likely will have a response by then.

@tmcw tmcw self-assigned this Apr 24, 2017
@tmcw
Copy link
Member

tmcw commented Apr 24, 2017

Sorry for the delay, here's the deal:

node_modules/.bin/documentation build src -o build_doc.json --polyglot --format json --github
 --parseExtension=cpp

--polyglot does not, after beta.18, automatically add extensions that documentation.js parses. So --parseExtension=cpp adds cpp to one of the extensions that documentation.js treats as parseable and looks for.

I'm not 100% confident about this design, but unfortunately none of the options are all that great:

We could:

  • Parse everything in the directory, potentially stumbling on Markdown and image files and so on
  • Have --polyglot automatically add --parseExtension=cpp --parseExtension=hpp, and hope that covers it? In this case, should --polyglot just be renamed --cpp instead?
  • Another option?

--parseExtension should solve this issue for you - if it doesn't, let me know. I'll keep this issue open for a while to see if anyone has ideas/opinions that might steer us in the right direction.

@tmcw tmcw removed their assignment Apr 24, 2017
@tmcw tmcw added the question label Apr 24, 2017
@tmcw tmcw changed the title Version 4.0.0-beta.18 doesn't generate documentation for c++ How should --polyglot mode control file extensions? Apr 24, 2017
@ikokostya
Copy link
Contributor Author

ikokostya commented Apr 24, 2017

Combination of --polyglot --parseExtension=cpp options works as expected, thanks.

From my point of view there are two problems:

  • --polyglot without --parseExtension does nothing. Maybe --polyglot option should require at least once --parseExtenstion option or print warning.
  • This change isn't described in CHANGELOG.md and docs/POLYGLOT.md.

tmcw added a commit that referenced this issue Jul 27, 2017
BREAKING CHANGE: I'd like to still support C++ and other languages in the future! But I'm much
happier doing so by separating the extraction & input phases to the degree that documentation.js can
read the output of another module that extracts JSDoc comments from C++ code, rather than having CPP
support in it.

Fixes #850. Fixes #731. Fixes #702. Fixes #132.
tmcw added a commit that referenced this issue Jul 27, 2017
BREAKING CHANGE: I'd like to still support C++ and other languages in the future! But I'm much
happier doing so by separating the extraction & input phases to the degree that documentation.js can
read the output of another module that extracts JSDoc comments from C++ code, rather than having CPP
support in it.

Fixes #850. Fixes #731. Fixes #702. Fixes #132.
@tmcw tmcw closed this as completed in #851 Jul 27, 2017
tmcw added a commit that referenced this issue Jul 27, 2017
BREAKING CHANGE: I'd like to still support C++ and other languages in the future! But I'm much
happier doing so by separating the extraction & input phases to the degree that documentation.js can
read the output of another module that extracts JSDoc comments from C++ code, rather than having CPP
support in it.

Fixes #850. Fixes #731. Fixes #702. Fixes #132.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants