jsdoc2md / jsdoc-to-markdown

Generate markdown documentation from jsdoc-annotated javascript
MIT License
1.68k stars 151 forks source link

How to describe interface with properties? #280

Open VityaSchel opened 2 years ago

VityaSchel commented 2 years ago

If I have an interface

interface Dog {
  name: string
  age: number
}

How to document it with JSDoc so this lib can parse it?

My failed attempt was

/**
 * An animal, human friend
 * @interface Dog
 * @property {string} name
 * @property {number} age
 * @memberof module:modulename
 */
interface Dog {
  name: string
  age: number
}
75lb commented 2 years ago

Does your failed attempt above work in jsdoc? If not, please ensure your docs generate correctly in jsdoc first (jsdoc2md works downstream of jsdoc)..

aureq commented 12 months ago

I think @75lb the question has more to do with "How do I get an interface documentation in the resulting output" rather than something is not working.

In my situation, it all works fine but somehow interface is not where to be found in the output, and there's no error message either. Perhaps you have an example somewhere you could share? Or there's a specific setting that needs to be turned on?

Thank you

75lb commented 3 weeks ago

but somehow interface is not where to be found in the output

Does it render correctly in jsdoc? If so, could you post some code and a command I can run against it to see it failing, thanks.. Will be able to give a more precise answer then..