arielsalminen / vue-design-system

An open source tool for building UI Design Systems with Vue.js
https://vueds.com
MIT License
2.17k stars 225 forks source link

Where is the markup for the docs defined? #155

Open johannesholmberg opened 5 years ago

johannesholmberg commented 5 years ago

I have looked around but can't find where the markup for the docs section is defined? For instance, if I would like add some extra information in the sidebar, where would be the proper place to put this?

Thanks for an awesome tool!

adabutch commented 5 years ago

I haven't yet looked into this but I'm curious too as it's been in the back of my mind, maybe vue-styleguidist?

lukenofurther commented 5 years ago

vue-styleguidist provides a way to override the rendering of the any named component, using the styleguideComponents config param. You can override the TableOfContents or the TableOfContentsRenderer components. If you override TableOfContents then you'll be replacing the whole thing, whereas if you override the Renderer then you can add whatever you want, while still rendering out children to render the TableOfContents component as well. There's also the LogoRenderer and Logo components you can override in the same way.

To override the components, add something like this to config/docs.config.js:

module.exports = {
  ...
  styleguideComponents: {
    TableOfContentsRenderer: path.join(__dirname, "../docs/components/TableOfContentsRenderer")
    LogoRenderer: path.join(__dirname, "../docs/components/LogoRenderer")
  }
  ...
}

Then write your overriding renderers similar to this as React components.