jsdoc-to-markdown icon indicating copy to clipboard operation
jsdoc-to-markdown copied to clipboard

Decorated classes get named "_class" in output .md file

Open paulheg opened this issue 2 years ago • 2 comments

Hello there, in the process of trying to create markdown documentation for an angular / typescript project I am encountering the following issue:

Every class that is decorated with something like @Component, will be called "_class" in the output .md file.

How can I get the correct classname?

I am using the following jsdoc2md.json file:

{
    "source": {
      "includePattern": ".+\\.ts(doc|x)?$",
      "excludePattern": ".+\\.(test|spec).ts"
    },
    "plugins": [
      "plugins/markdown",
      "node_modules/jsdoc-babel"
    ],
    "babel": {
      "extensions": ["ts", "tsx"],
      "ignore": ["**/*.(test|spec).ts"],
      "babelrc": false,
      "presets": [
        ["@babel/preset-env", { "targets": { "node": true } }],
        "@babel/preset-typescript"
      ],
      "plugins": [
        ["@babel/plugin-proposal-decorators", { "legacy": true }],
        "@babel/plugin-proposal-class-properties",
        "@babel/plugin-proposal-object-rest-spread"
      ]
    }
  }

paulheg avatar Jun 14 '22 19:06 paulheg

I have the same problem, did you solve it?

nicolas-tesla-x avatar Jun 23 '22 02:06 nicolas-tesla-x

Unvortunately I couldnt fix it.

I moved on to transpile the typescript code to javascript and go from there using: tsc -p tsconfig.json &>/dev/null

You have to lookup the output dir in the tsconfig.json and pass it on to jsdoc2md.

I hope this helps.

paulheg avatar Jun 23 '22 16:06 paulheg