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

Better rendering for curried functions #714

Open TomerAberbach opened 3 weeks ago

TomerAberbach commented 3 weeks ago

What package is the feature request related to?

typedoc-plugin-markdown

Background

I'm using typedocs-plugin-markdown for a library of mine that has many curried functions, and unfortunately it currently generates overly verbose documentation for those functions.

For example, for this function: https://github.com/TomerAberbach/lfi/blob/fd6e1ff9d7b7d249090f89ead6d0a30e26aba2e4/src/operations/predicate.d.ts#L203-L223

I get these docs: https://github.com/TomerAberbach/lfi/blob/fd6e1ff9d7b7d249090f89ead6d0a30e26aba2e4/docs/functions/includes.md

There are a couple of problems here:

  1. There is one documentation comment for all the overloads, but it's rendered multiple times
  2. One function is basically a "prefix" of the other so I would expect them to be merged somehow

Proposed solution

In terms of prior art, based on the screenshot in this comment, https://github.com/TypeStrong/typedoc/issues/1421#issuecomment-751407709, it seems like the regular typedoc is able to handle this case with some sort of overload signature merging? Might be worth looking into what logic typedoc is doing there. I tried to figure it out, but couldn't nail down where it happens.

tgreyuk commented 2 weeks ago

Thank you. Will take a look and try to align with the default theme as much as possible.

TomerAberbach commented 2 weeks ago

Thank you!