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

Non-unique ids bug #303

Closed
jackens opened this issue Apr 4, 2022 · 4 comments
Closed

Non-unique ids bug #303

jackens opened this issue Apr 4, 2022 · 4 comments

Comments

@jackens
Copy link

jackens commented Apr 4, 2022

typedoc.json:

{
  "cleanOutputDir": true,
  "entryPointStrategy": "expand",
  "entryPoints": [
    "src"
  ],
  "hideBreadcrumbs": true,
  "hideInPageTOC": true,
  "hideLegend": true,
  "namedAnchors": true,
  "out": "_doc",
  "readme": "none"
}

tsconfig.json:

{
  "compilerOptions": {
    "allowJs": true,
    "module": "commonjs",
    "outDir": "tmp",
    "target": "esnext"
  },
  "include": [
    "src/**/*.js"
  ]
}

package.json:

{
  "dependencies": {
    "typedoc": "0.22.13",
    "typedoc-plugin-markdown": "3.11.14",
    "typescript": "4.6.3"
  },
  "name": "non-unique-ids-bug",
  "type": "module"
}

src/file.js

/**
 * @typedef {() => number} ANSWER
 */

/**
 * @type ANSWER
 */
export const answer = () => 42

Executing

npm i
npx typedoc

generates the following _doc/README.md file with multiple id="answer":

# non-unique-ids-bug

## Type aliases

### <a id="answer" name="answer"></a> ANSWER

Ƭ **ANSWER**<\>: () => `number`

#### Type declaration

▸ (): `number`

##### Returns

`number`

#### Defined in

file.js:2

## Functions

### <a id="answer" name="answer"></a> answer**answer**(): `number`

#### Returns

`number`

#### Defined in

file.js:8
@tgreyuk
Copy link
Member

tgreyuk commented Apr 9, 2022

Thanks for detailed description. Fix in typedoc-plugin-markdown@3.12.0.

@KillyMXI
Copy link

I've got a false positive with 3.12.0 - links to a unique heading got an index added.
I think that will not work on GitHub so I'm staying on ~3.11.14 for now.

Inside the file https://github.com/mxxii/parseley/blob/main/docs/modules/Ast.md it creates the following link
[`Specificity`](Ast.md#specificity-6)
for the unique heading.

@tgreyuk
Copy link
Member

tgreyuk commented Apr 21, 2022

@KillyMXI thanks - i see the issue - it should now be fixed (typedoc-plugin-markdown@3.12.1)

@KillyMXI
Copy link

Thank you. 3.12.1 works fine.

@tgreyuk tgreyuk closed this as completed Apr 22, 2022
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

3 participants