alphagov / govuk-frontend

GOV.UK Frontend contains the code you need to start building a user interface for government platforms and services.
https://frontend.design-system.service.gov.uk/
MIT License
1.19k stars 328 forks source link

Decide how to document our component JavaScript API #2563

Closed vanitabarrett closed 1 year ago

vanitabarrett commented 2 years ago

What

On the Design System website, we have documentation for each component that tells users about the Nunjucks API (macro options). We should decide how we will document any public JavaScript methods that a user needs to know about, e.g: init methods and any public functions they may need to hook into or call for certain components (for example, character count).

It may make sense to pick this work up after we've completed https://github.com/alphagov/govuk-frontend/issues/1722

Why

So we have a plan for how to inform users about what JavaScript methods are available to them, when they might need to use them and why. We should make sure this information is easily discoverable rather than relying on users digging into our code on Github to find out more.

This work will become more important as we pick up more complex components, like modals, when it's likely users will need to interact with our JavaScript functions more.

Who needs to work on this

Developers; Tech Writer; potentially Design too

Who needs to review this

Developers; Tech Writer

Done when

Note: this card does not include actually writing and publishing the documentation. There is a separate card for drafting and publishing the documentation

36degrees commented 1 year ago

Closing as we're now publishing our JavaScript API Reference as part of the frontend docs