Aratramba / design-manual

Lightweight Design System Generator
http://eightmedia.github.io/design-manual
15 stars 1 forks source link

add middleware option #92

Open Aratramba opened 6 years ago

Aratramba commented 6 years ago

if we add an option to alter the components data feed before rendering components and pages, we could for example concat multiple components that share the same name, or decide not to on a component basis.

DesignManual.build({
  output: 'docs/',
  pages: './',
  components: 'docs/components.json',
  middleware: (components) => {
      // do something
      return components;
  },
  meta: {
    domain: 'example.com',
    title: 'Example'
  }
});

This solves a problem where collect components outputs multiple components with the same name - something design manual by design can not use.