Skip to content

ES6 Modules Support #865

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

Closed
delano-infodatek opened this issue Aug 4, 2017 · 1 comment
Closed

ES6 Modules Support #865

delano-infodatek opened this issue Aug 4, 2017 · 1 comment

Comments

@delano-infodatek
Copy link

I'm trying to document a ES6 module, but I cannot get documentationjs to group it correctly. The module I'm trying to document looks something like this:

import module from "module"

export const x = {}
export function y() {}

I initially tried the example over at http://usejsdoc.org/howto-es2015-modules.html to modify my module to something like this:

/** @module moduleName */
import module from "module"

/** x */
export const x = {}
/** y */
export function y() {}

This placed every member of the module on the root like this:

root
└─ moduleName
└─ x
└─ y

But I want this format:

root
├─ moduleName
│ └─ x
│ └─ y

I also tried@namespace, that did the exact same. Then I tried @alias, @name with and without @member, to try and get the exported functions, variables and constants grouped under the module name, but this also place them after each other under the root, even with names like module:moduleName#function or moduleName.function

After that I tried to create a dummy class with the name of the module to see if it tried to group them to the class but still no succes.

I'm not sure if this not yet supported, or if this is a bug. Either way I would really like to know how to resolve this. I think this might be solved using the documentation.yml, but I'm not really sure how to use it.

  • What version of documentation.js are you using?: 5.1.0
  • How are you running documentation.js (on the CLI, Node.js API, Grunt, other?): Using CLI
@tmcw
Copy link
Member

tmcw commented Aug 12, 2017

Thanks for the report! This is a duplicate of a previous issue, #803, so I'm closing it in favor of that issue. You're right that the module syntax does not work as it does in JSDoc currently, and I'd happily review a PR that fixes it if you'd like to help.

@tmcw tmcw closed this as completed Aug 12, 2017
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

2 participants