Closed ocavue closed 7 months ago
Thank you - will fix this.
On a related note, you can actually format the output with Prettier using typedoc-plugin-remark. Example output here - https://github.com/tgreyuk/typedoc-plugin-markdown-examples/tree/main/examples/03-typedoc-plugin-remark#prettier.
Oh thanks. I didn't know about typedoc-plugin-remark
before.
For this particular code block, Prettier cannot format it. I found that I need to add a function
keyword at the beginning to make Prettier work. I can achieve this by overriding helpers.getKeyword
. typedoc-plugin-markdown
's API is very flexible and I love it.
// Prettier cannot format this
fn(
a: () => number,
b: number,
c: GetNum): void
// Prettier can format this
function fn(
a: () => number,
b: number,
c: GetNum): void
Thanks - thats a good spot actually. The function keyword should be present when useCodeBlocks
are enabled.
Giving the following source code,
And the following typedoc config,
I get the result below: