Skip to content

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

Closed

Description

@ikokostya

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)
{
}

Activity

  1. tmcw commented on Mar 31, 2017

    @tmcw
    Member

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

  2. self-assigned this
    on Apr 24, 2017
  3. tmcw commented on Apr 24, 2017

    @tmcw
    Member

    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.

  4. removed their assignment
    on Apr 24, 2017
  5. changed the title [-]Version 4.0.0-beta.18 doesn't generate documentation for c++[/-] [+]How should --polyglot mode control file extensions?[/+] on Apr 24, 2017
  6. ikokostya commented on Apr 24, 2017

    @ikokostya
    ContributorAuthor

    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.
  7. added 2 commits that reference this issue on Jul 27, 2017
    3ba5ffe
    7b982ea
  8. added a commit that references this issue on Jul 27, 2017
    5b373ff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions