jsdoc2md / jsdoc-to-markdown

Generate markdown documentation from jsdoc-annotated javascript
MIT License
1.69k stars 152 forks source link

This experimental syntax requires enabling the parser plugin: "importAssertions" #283

Closed ChildishGiant closed 1 year ago

ChildishGiant commented 2 years ago

I'm trying to use this on my project that uses import assertions to import json but this currently throws an error This experimental syntax requires enabling the parser plugin: "importAssertions" and I don't see a way to do that currently.

doubleedesign commented 1 year ago

I'm having the same issue. I've worked out some syntax for using it with npm run that seems like it will work:

My syntax is: "docs": "jsdoc2md --plugin importAssertions --source app.js > docs.md"

...but I can't find the plugin itself (or any mention of it) online anywhere (so I get the error "Cannot find plugin: importAssertions."

AddictArts commented 1 year ago

Is it possible there is a dev dependency needed, something that jsdoc2markdown's dependency ends up using? Something like babel-import-assertions, something like that.

https://www.npmjs.com/package/@babel/plugin-syntax-import-assertions

75lb commented 1 year ago

See the jsdoc2md -c option:

  -c, --configure file   Path to a jsdoc configuration file, passed directly to `jsdoc -c`.

This option passes config into jsdoc.. See the jsdoc config docs for more info..

karmaniverous commented 1 year ago

So far as I can tell, there is no mention ANYWHERE of this plugin.

@75lb while I appreciate your comment I don't see how it solves the problem... the question is not where to configure the plugin but what plugin to configure!

What am I missing here?

karmaniverous commented 1 year ago

Hey @75lb I'd really appreciate a little guidance here! We're using import assertions all over the place--because it's 2023--and it's killing our ability to use this otherwise very excellent tool.

Please help!

75lb commented 1 year ago

Morning @karmaniverous, apologies if I missed the crux of the issue.. Does your code documentation generate correctly if you use jsdoc directly? Meanwhile, I will try to reproduce this..

75lb commented 1 year ago

This is an issue upstream with jsdoc, I have posted a jsdoc issue asking how to solve it.. If anyone figures out a solution, please post here and on the jsdoc issue..

karmaniverous commented 1 year ago

Ahhhh the dreaded upstream issue!

Thanks for responding so quickly. I'm keeping an eye on this one as well. Ping me if you need any help resolving!

75lb commented 1 year ago

Apparently the upstream ticket is resolved now, could you update jsdoc2md to pick up the change and give it a test please?

karmaniverous commented 1 year ago

AWESOME! Works great. Just an FYI for the others, there's no version update to jsdoc2md. I had to uninstall & reinstall to pick up the deep dependency changes.

Cooking with gas now. Thank you sir!!