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

module with multiple classes outputs multiples of the same function #184

Open
mlg-rbalhorn opened this issue Mar 9, 2019 · 3 comments
Open
Labels
jsdoc2md Concerns the jsdoc2md CLI app more info More info required to reproduce template Requires a change to a dmd partial/helper

Comments

@mlg-rbalhorn
Copy link

mlg-rbalhorn commented Mar 9, 2019

I have a module with multiple exported classes
Each class is in its own file in the libs folder. I consider them separate modules as but combined into one as they are related and some scripts only need 2 or 3 of the classes etc. anyway...

I have a template set up with the API output as such:

{{#modules}}
### {{name}}
{{description}}
{{>body~}}
{{#functions}}
####{{../typicalname}}.{{name}}(params)
{{description}}
{{>body~}}
{{/functions}}
{{/modules}}

When I export jsdoc2md --template ./README.hbs ./libs/*.js > ./README.md

I get the a loop of all functions from all pages put out the number of pages.

eg.

module1.function 1
module1.function 2
module1.function 3
module2.function 1
module2.function 2
module2.function 3
module3.function1
module4.function1
module1.function 1
module1.function 2
module1.function 3
module2.function 1
module2.function 2
module2.function 3
module3.function1
module4.function1
module1.function 1
module1.function 2
module1.function 3
module2.function 1
module2.function 2
module2.function 3
module3.function1
module4.function1
module1.function 1
module1.function 2
module1.function 3
module2.function 1
module2.function 2
module2.function 3
module3.function1
module4.function1

so in otherwords, its ouputting all the functions from all pages for each script so I get 4 duplicates as it sees them as a single module. I am not sure how to fix this.

Obviously, what I need is:

module1.function 1
module1.function 2
module1.function 3
module2.function 1
module2.function 2
module2.function 3
module3.function1
module4.function1

@mlg-rbalhorn
Copy link
Author

also, even if I reduce the template to just:

{{#functions}}
####{{../typicalname}}.{{name}}(params)
{{/functions}}

I still get:

function 1
function 2
function 3
function 1
function 2
function 3
function1
function1
function 1
function 2
function 3
function 1
function 2
function 3
function1
function1
function 1
function 2
function 3
function 1
function 2
function 3
function1
function1
function 1
function 2
function 3
function 1
function 2
function 3
function1
function1

@75lb
Copy link
Member

75lb commented Mar 25, 2021

could you post some dummy input files I could use to reproduce this?

@75lb 75lb added the more info More info required to reproduce label Mar 25, 2021
@Abdilar
Copy link

Abdilar commented Jan 27, 2024

use --files flag. like this:

./node_modules/jsdoc-to-markdown/bin/cli.js --configure .jsdoc.json --files src > API.md

It's worked for me

@75lb 75lb added template Requires a change to a dmd partial/helper jsdoc2md Concerns the jsdoc2md CLI app labels Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jsdoc2md Concerns the jsdoc2md CLI app more info More info required to reproduce template Requires a change to a dmd partial/helper
Development

No branches or pull requests

3 participants