crawlee icon indicating copy to clipboard operation
crawlee copied to clipboard

docs: messy rendering of edited types

Open barjin opened this issue 5 months ago • 2 comments

If the parameter / return type is wrapped in utility types (adding / omitting / excluding some properties or types), the Docusaurus plugin resolves the utility types, which results in a (factually) correct, but messy docs:

https://github.com/apify/crawlee/blob/cfdf6da27fa5ed049a49f3d348a5db0015f3dd6b/packages/core/src/enqueue_links/enqueue_links.ts#L274-L282

Image

(note that the requestQueue param is missing and the urls param is required)

barjin avatar Jul 29 '25 15:07 barjin

Unfortunately, I see the follwoing as the only way out right now - any more complex type resolving in the docusaurus typedoc plugin seems tedious and much more error prone.

An easy way out - we can stop using inlined utility types and create separate exported interfaces for each "edited" type:

Image

These will render nicely in the docs (compare with the screenshot from the original issue):

method page separate interface page
Image Image

The downside is the added code verbosity and a bunch of new, almost duplicate, "Interface" pages in the docs. wdyt @janbuchar @B4nan - is the docs clarity worth the added bloat?

barjin avatar Aug 13 '25 10:08 barjin

The downside is the added code verbosity and a bunch of new, almost duplicate, "Interface" pages in the docs. wdyt @janbuchar @B4nan - is the docs clarity worth the added bloat?

In my opinion it's not. Having to come up with a name for each of these new types would be a serious pain, and it would inevitably lead to confusion because of similarly callled types.

janbuchar avatar Aug 13 '25 10:08 janbuchar