Skip to content

Add refresh button to the api docs examples #3287

@ST-DDT

Description

@ST-DDT

Clear and concise description of the problem

Currently, the documentation only provides a single example per invocation, this could result in wrong expectations of method return values.

See:

Suggested solution

Adding a refresh button to the example sections:

apidocs-refresh-button.mp4

For that to work, we have to

  • trigger downloading of the latest faker version (on first press)
  • change our apidocs json data to be js/ts, so that we can store actual code in there
  • add a function () => unknown[] to the export data from the actual examples
  • take each result JSON.stringify it and insert into the code block

Alternative

Add more examples for the no args examples.

Additional context

Original issue:

Original fix suggestion:

Alternative suggestion for a fix:

Metadata

Metadata

Assignees

Labels

c: docsImprovements or additions to documentationp: 1-normalNothing urgents: acceptedAccepted feature / Confirmed bug

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions