typedoc-plugin-markdown icon indicating copy to clipboard operation
typedoc-plugin-markdown copied to clipboard

[typedoc-plugin-markdown] `@example` block not rendered with Headline

Open homj opened this issue 1 year ago • 1 comments

I just got started using the typedoc-plugin-markdown plugin (and typedoc in general). First of all: this is an awesome project, thank you so much for investing your time in helping other generate great docs out of JSDoc.

While using this plugin, I noticed that @example blocks are rendered in a weird way, where "Example" is not a headline, but rendered as bold code:

Input
/**
 * A function that does something.
 *
 * @example
 * This is an example
 *
 * ```ts
 * const foo = 'bar';
 *
 * @param name - Your name
 * @returns Whether the name is not null
 */
export function myFunction(name: string) {
    return name != null;
}
### myFunction

▸ **myFunction**(`name`): `boolean`

A function that does something.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `name` | `string` | Your name |

#### Returns

`boolean`

Whether the name is not null

**`Example`**

This is an example

```ts
const foo = 'bar';
```

#### Defined in

...

In my opinion, it should be rendered as #### Example, just like the other headlines. Is there a way to customize this behavior, or is this a bug?

homj avatar Nov 16 '23 17:11 homj

Thanks. Yes completely agree and this is indeed the behaviour in typedoc-plugin-markdown@next, however this probably won't make it into v3.

tgreyuk avatar Nov 19 '23 22:11 tgreyuk

[email protected]

tgreyuk avatar May 03 '24 16:05 tgreyuk