Open mattrosno opened 2 years ago
Right now, each indexed asset gets its own name, description, thumbnail, status, framework, etc. That's great for discovery, like Dropdown for example, where the catalogs actually index:
Ideally, those three assets are documented as variants of Dropdown, so there's one asset detail page that explains all three together.
We could add a redirect
key to the asset schema, like:
assets:
dropdown:
name: Dropdown
....
combo-box:
name: Combo box
redirect: dropdown
...
multiselect:
name: Multiselect
redirect: dropdown
...
If an asset has a redirect
key, then it wouldn't have detail pages. Instead, when you select one of those catalog items, it would take you to the specified destination (e.g. selecting Multiselect would take you to the Dropdown detail pages.)
We could have a display naming convention so the redirect destination is suffixed with (Name)
, e.g. combo box below:
Instead, we could index one of the assets as canonical and the non-canonical (a.k.a. variant) detail pages have duplicated content.
assets:
dropdown:
name: Dropdown
docs:
overviewPath: '/path/to/overview.mdx'
usagePath: /path/to/usage.mdx
stylePath: /path/to/style.mdx
codePath: '/path/to/code.mdx'
accessibilityPath: /path/to/accessibility.mdx
....
combo-box:
name: Combo box
canonical: dropdown
docs:
$ref: '#/assets/dropdown/docs'
overviewPath: '/path/to/overview.mdx'
codePath: '/path/to/code.mdx'
...
multiselect:
name: Multiselect
canonical: dropdown
docs:
$ref: '#/assets/dropdown/docs'
overviewPath: '/path/to/overview.mdx'
codePath: '/path/to/code.mdx'
...
In this example, the Dropdown asset has the full documentation that details usage, style, and accessibility guidance for all three variants, and that usage, style, and accessibility content is also used in Combo box and Multiselect assets.
The canonical
key is just used for SEO purposes, so search engines know to just index the Dropdown pages, as the Combo box and Multiselect pages are mostly duplicate.
Recommendation:
$ref
sdocs
related
to assets schema, so each overview can have a table (or resource cards) that link to other assets (e.g. link to variants, or if it's a pattern link to the components used in that pattern)With UX enhancements:
Summary
The platform schema and indexing strategy has not yet accounted for component variants, and that has resulted in inconsistent indexing among libraries, and decomposed documentation when it's a better user experience to document like-components (a.k.a. variants) together.
Notification component example
https://next.carbondesignsystem.com/assets/components?q=notification - here you can see that Carbon Svelte and Carbon Vue indexed
Inline notification
andToast notification
separately, where Carbon React, Carbon Angular, and Carbon Vanilla has this indexed asNotification
. All of those notification components inherit from the Carbon CoreNotification
. Since Carbon Svelte and Vue notification is indexed different from the rest, they can't inherit theNotification
usage, style, and accessibility documentation like Carbon React, Angular, and Vanilla.Create flows pattern example
Here you can see that the
Create flows
pattern is originally documented as one create pattern that has variations: https://pages.github.ibm.com/cdai-design/pal/patterns/creation-flows/usage. Those have been indexed as separate patterns: https://next.carbondesignsystem.com/assets/patterns?maintainer[]=ibm-products&q=create. Is that decomposition ideal? Would it be easier if allCreate flow
guidance was co-located in one pattern?List example
The legacy site documents one
List
component with two variants: https://carbondesignsystem.com/components/list/usage/. Carbon React and Carbon Svelte have this indexed asOrdered list
andUnordered list
: https://next.carbondesignsystem.com/assets/components?q=ordered. As such, the those detail pages are missing usage, style, and accessibility documentation because the Carbon Core, Carbon Angular, Carbon Vue, and Carbon Vanilla index this component asList
(not decomposed), for example: https://next.carbondesignsystem.com/libraries/carbon-styles/latest/assets/listTheme component and function example
The Carbon React library has a
Theme
component and auseTheme
hook (function):Yet, there's no need for these assets to have separate detail pages.
They should be documented together. The component and the hook are part of the same functionality to get and set the current color theme.
Job stories
Acceptance criteria
demoLinks