typedoc2md / typedoc-plugin-markdown

A plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown.
https://typedoc-plugin-markdown.org
MIT License
725 stars 177 forks source link

bug: descriptions are being dropped for "other" category symbols #664

Closed favna closed 3 months ago

favna commented 3 months ago

What package is the bug related to?

typedoc-plugin-markdown

Describe the issue

[!NOTE] I first reported this for starlight-typedoc, however this appears to be an issue with the underlying typedoc-plugin-markdown instead. See: https://github.com/HiDeoo/starlight-typedoc/issues/55

For the project https://github.com/skyra-project/discord-components I use public accessor because that's how Lit Element works when using TC39 decorators. When parsing this with regular typedoc (config below) the accessor still do get put into the "other" category just like typedoc-plugin-markdown does, however unlike typedoc-plugin-markdown, regular typedoc still retains descriptions.

Relevant code: https://github.com/skyra-project/discord-components/blob/e34e27efff4d1fb3d41def616bed017d97964d34/packages/core/src/components/discord-audio-attachment/DiscordAudioAttachment.ts#L124-L169

From the HTML generated by Typedoc: ishare-1722689243

From the HTML generated by starlight-typedoc (which uses typedoc-plugin-markdown):

ishare-1722689271

To Reproduce

  1. Clone https://github.com/skyra-project/discord-components
  2. Run git switch bugreport/starlight-typedoc-other-descriptions to switch to a branch with some files prepared for this bug report
  3. Run yarn install --immutable
  4. Run yarn build
  5. Run yarn bug:starlight
  6. Navigate to http://localhost:4321/api/classes/discordaudioattachment/#bytes
  7. In a new terminal run yarn bug:typedoc, this will build with regular typedoc and start an HTTP server on port 8090
  8. Navigate to http://localhost:8090/classes/DiscordAudioAttachment.html#bytes

TypeDoc configuration

{
    "readme": "../documentation/src/assets/README.md",
    "excludeExternals": true,
    "githubPages": true,
    "disableSources": true,
    "entryPoints": ["./src/index.ts"],
    "tsconfig": "./src/tsconfig.json",
    "basePath": "/",
    "out": "./docs",
    "cleanOutputDir": true
}

Expected behavior

The tsdoc comments from accessors (other category symbols) aren't dropped

System Info

  System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M1
    Memory: 70.73 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.4.0 - /private/var/folders/jy/w45_1th97698mzgm_nsfl35w0000gn/T/xfs-2eeb1fb6/node
    Yarn: 4.3.1 - /private/var/folders/jy/w45_1th97698mzgm_nsfl35w0000gn/T/xfs-2eeb1fb6/yarn
    npm: 10.8.1 - ~/.volta/tools/image/node/22.4.0/bin/npm
    pnpm: 9.6.0 - ~/.volta/bin/pnpm
    bun: 1.1.21 - /opt/homebrew/bin/bun
  Browsers:
    Edge: 127.0.2651.86
    Safari: 17.5
  Packages:
    @astrojs/lit: ^4.3.0,
    @astrojs/starlight: 0.25.3,
    astro: 4.12.3,
    starlight-typedoc: 0.13.1,
    typedoc: 0.26.5,
    typedoc-plugin-markdown: 4.2.3
tgreyuk commented 3 months ago

Thanks - have a fix and it will go into the next release.

tgreyuk commented 3 months ago

Should be fixed in typedoc-plugin-markdown@4.2.4 .

favna commented 3 months ago

Alas it appears that this is not yet fully fixed. I am definitely on the right version:

-1723636246

But the generated markdown only has doc comments for the author field and none of the others:

---
editUrl: false
next: true
prev: true
title: DiscordMessage
---

## Extends

- `LitElement`

## Implements

- [`LightTheme`](/api/interfaces/lighttheme/)

## Constructors

### new DiscordMessage()

> **new DiscordMessage**(): [`DiscordMessage`](/api/classes/discordmessage/)

#### Returns

[`DiscordMessage`](/api/classes/discordmessage/)

#### Inherited from

`LitElement.constructor`

## Accessors

### author

The message author's username.

#### Default Value

\```ts
'User'
\```

***

### avatar

***

### bot

***

### compactMode

***

### dismissMessageClicked

***

### edited

***

### ephemeral

***

### hasThread

***

### highlight

***

### lightTheme

#### Implementation of

[`LightTheme`](/api/interfaces/lighttheme/).[`lightTheme`](/api/interfaces/lighttheme/#lighttheme)

***

### messageBodyOnly

***

### noBackground

***

### op

***

### profile

***

### roleColor

***

### roleIcon

***

### roleName

***

### server

***

### timestamp

***

### twentyFour

***

### verified

I have updated the bugreport/starlight-typedoc-other-descriptions with the latest dependencies where the issue can still be reproduced.

tgreyuk commented 3 months ago

@favna apologies. It really should be fixed in 4.2.5:

Screenshot 2024-08-15 at 23 37 04
favna commented 3 months ago

Confirmed! Tyvm!!