Skip to content
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

Clarify docs for all nested options #3919

Merged
merged 7 commits into from
Aug 4, 2023
Merged

Clarify docs for all nested options #3919

merged 7 commits into from
Aug 4, 2023

Conversation

colinrotherham
Copy link
Contributor

@colinrotherham colinrotherham commented Jul 6, 2023

I noticed last week that we sometimes "dot-prefix" nested option names with the associated parent or component

The Prototype Kit team are looking into generating documentation from component macro-options.json so this change copies what we did for Radios and Checkboxes conditional to structure all nested options correctly

Accordion

  1. heading.text, heading.htmlheading
  2. summary.text, summary.htmlsummary
  3. content.text, content.htmlcontent

Summary list

  1. key.text, key.htmlkey
  2. value.text, value.htmlvalue
  3. actions.text, actions.htmlactions

Like other nested options, these now show as separate tables (with links) on the Design System website:

Accordion items showing nested options

@colinrotherham colinrotherham added the documentation User requests new documentation or improvements to existing documentation label Jul 6, 2023
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3919 July 6, 2023 17:51 Inactive
@colinrotherham
Copy link
Contributor Author

@colinrotherham colinrotherham changed the title [SPIKE] Clarify docs for all nested options Clarify docs for all nested options Jul 11, 2023
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3919 July 11, 2023 16:14 Inactive
@colinrotherham
Copy link
Contributor Author

We may still want to bring back "dot-prefix" nested object names for readability:

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3919 July 17, 2023 08:12 Inactive
@colinrotherham colinrotherham self-assigned this Jul 20, 2023
Copy link
Contributor

@36degrees 36degrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Raised a few suggestions, mainly to try and avoid having multiple 'If x is set' in the same description.

Noticed we're using multiple words to describe when an option is set ('set', 'provided', 'supplied'…) – standardised on 'provided' for now just so we're at least consistent when describing a single option.

Have also added a card to the Trello board to try and address more fully: https://trello.com/c/HvWJ2GMc/20-we-talk-about-options-being-set-provided-supplied-specified-sometimes-within-the-same-description

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3919 August 1, 2023 15:17 Inactive
@colinrotherham
Copy link
Contributor Author

Rebased with latest main

Copy link
Member

@romaricpascal romaricpascal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, thanks for tidying those up 🙌🏻 @claireashworth do you want to have a quick look maybe before we merge this in as it's mostly content related? 😊

@colinrotherham
Copy link
Contributor Author

colinrotherham commented Aug 4, 2023

Thanks @romaricpascal

@claireashworth I've pulled together the same "format" used in both #3878 and #3902

description: If `html` is set, this is not required. The ${child} of each ${parent}. ${description}. If `html` is provided, the `text` option will be ignored.

It's wordy, repetitive, but what we use the most at the moment

We should do a follow up once the Design System Nunjucks docs issues Trello board has been reviewed

@colinrotherham colinrotherham merged commit a38f59c into main Aug 4, 2023
41 checks passed
@colinrotherham colinrotherham deleted the nested-option branch August 4, 2023 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation User requests new documentation or improvements to existing documentation
Projects
Development

Successfully merging this pull request may close these issues.

5 participants