-
Notifications
You must be signed in to change notification settings - Fork 39
feat: Generated JSDocs based on the API reference #797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 13 commits
a2ca7c3
90c248f
83b635d
f21b4d7
1dbbf39
7f58e0c
7bc9fd1
8857b22
ef35ff3
35bf257
a531b88
1142122
1b49bdd
e2bb026
2fc82f1
532cfb5
be5294d
c1214ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,29 @@ import type { PaginatedIterator, PaginatedList, PaginationOptions } from '../uti | |
| import type { Actor, ActorDefaultRunOptions, ActorExampleRunInput, ActorStandby } from './actor'; | ||
| import type { ActorVersion } from './actor_version'; | ||
|
|
||
| /** | ||
| * Client for managing the collection of Actors in your account. | ||
| * | ||
| * Provides methods to list and create Actors. To access an individual Actor, | ||
| * use the `actor()` method on the main ApifyClient. | ||
| * | ||
| * @example | ||
| * ```javascript | ||
| * const client = new ApifyClient({ token: 'my-token' }); | ||
| * const actorsClient = client.actors(); | ||
| * | ||
| * // List all Actors | ||
| * const { items } = await actorsClient.list(); | ||
| * | ||
| * // Create a new Actor | ||
| * const newActor = await actorsClient.create({ | ||
| * name: 'my-actor', | ||
| * title: 'My Actor' | ||
| * }); | ||
| * ``` | ||
| * | ||
| * @see https://docs.apify.com/platform/actors | ||
| */ | ||
| export class ActorCollectionClient extends ResourceCollectionClient { | ||
| /** | ||
| * @hidden | ||
|
|
@@ -18,7 +41,11 @@ export class ActorCollectionClient extends ResourceCollectionClient { | |
| } | ||
|
|
||
| /** | ||
| * https://docs.apify.com/api/v2#/reference/actors/actor-collection/get-list-of-actors | ||
| * Lists all Actors. | ||
| * | ||
| * @param options - Pagination options. | ||
| * @returns A paginated iterator of Actors. | ||
| * @see https://docs.apify.com/api/v2/acts-get | ||
|
||
| * | ||
| * Awaiting the return value (as you would with a Promise) will result in a single API call. The amount of fetched | ||
| * items in a single API call is limited. | ||
|
|
@@ -49,7 +76,11 @@ export class ActorCollectionClient extends ResourceCollectionClient { | |
| } | ||
|
|
||
| /** | ||
| * https://docs.apify.com/api/v2#/reference/actors/actor-collection/create-actor | ||
| * Creates a new Actor. | ||
| * | ||
| * @param actor - The Actor data. | ||
| * @returns The created Actor object. | ||
| * @see https://docs.apify.com/api/v2/acts-post | ||
| */ | ||
| async create(actor: ActorCollectionCreateOptions): Promise<Actor> { | ||
| ow(actor, ow.optional.object); | ||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this renders properly
@B4nan could it be due to some custom solution we have?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is how it's supposed to look, there is no "native view for
@exampletag".There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but shouldn't it be rendered as heading not as explicit
@example?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, i dont think so, those tags are not really supposed to be headings, i'd say the
@exampletag is the only one where i'd expect a block content, the rest is usually inline, like@see, @link, @internal, @deprecated.of course, its up to us how we want it, but if you are asking how the plugin works, i think this is how.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it would look pretty good if we add some vertical padding and lower the left padding. i am actually surprised that it renders the code block correctly with the syntax highlighting :]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Padding for sure, but I think both
@example&@seeshould be headings as they provide sectionsExample section
examples here
See section (or further reading or whatever)
links here
Or technically we could just use markdown as it seems to be accepting it well enough from my local testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are talking about whitelisting some tags that should be rendered as blocks, sure, for
@exampleit makes sense. But generally speaking, they really are mostly inline things, not blocks. Checking the crawlee codebase, I havent seen a single block tag other than@example. Often they don't even need content, e.g.@ignore, @internal(although those won't be part of the docs in our setup), and often the content is a scalar value, not a sentence (like@default 10or@param [options]or@returns number[]).