Open MisRob opened 11 hours ago
Labeling as "good first issue" since its pretty straightforward and can be tested easily, but note that it's medium size. Furthermore, if it's your first encounter with the documentation website, some time will be needed to understand the current documentation mechanism well.
🌱 Are you new to the codebase? Welcome! Please see the contributing guidelines.
Desired behavior
Create a new documentation component
DocsExample
that toggles between an example and its code on the documentation website.Here is one example demonstrating the expected visual output. For this
KCard
demonstration (source, output)should produce the following:
(1) On an initial page load, we'd only show the card passed via the
#example
slot(2) The code sample related to the example would be passed via the
#code
slot(3)
DocsExample
would render a toggle button to "View code"/"Hide code" in its top right corner. Clicking it would show/hide the code above the card:The overall experience would be similar to that of the Vuetify documentation:
Current behavior
Right now we show code above or below the example, or not at all, and there is no way to toggle it:
The Value Add
Guidance
DocsShow
andDocsShowCode
and how they are used on documentation pages:DocsExample
that produces the "Desired behavior"DocsShow
andDocsShowCode
and be responsible only for switching between themDocsShow
andDocsShowCode
to not cause regressions in the current documentation websiteDocsExample
on theKCard
documentation page to demonstrate it worksOut of scope
At this stage, we only want to focus on creating
DocsExample
. Please do not refactor all examples on all website pages with it.Acceptance criteria
DocsExample
documentation component as specified aboveDocsExample
internally switches betweenDocsShow
andDocsShowCode
DocsShow
andDocsShowCode
DocsExample
is used in one place to demonstrate it works