Open frankieroberto opened 4 days ago
I’d be up for making this an ‘officially unofficial’ component. We already use it in a few places (Prototype components, Accessibility mistakes) and can see it being useful as a component you might want to include in reference documentation.
And I agree, keeping the more opinionated bits out of the component makes sense. Let it do one thing well. No reason why those functions couldn’t be exports
though, and able to be unofficially imported into other projects as Nunjucks globals.
This changes the design of the code examples component from this:
to this:
ie - the tabs are at the bottom, and the preview remains on top. This more closely aligns with the styled used by the GOV.UK Design System, and means you can see the preview and the HTML or Nunjucks code at the same time.
The 'Example' component is also moved from being just within the documentation site itself, to being exported with the GOV.UK Prototype Components package itself.
This means there could be a documentation page for the Example component itself, with examples, inception-style...:
Code all needs tidying up and making more robust, but this is a first stab to see if it looks like a good idea or not...