2.53.0 • Published 11 days ago

@telus-uds/docusaurus-plugin-component-docs-pages v2.53.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 days ago

Docusaurus plugin component docs pages 📖

Docusaurus plugin for reusing base component mdx pages

Setup

  1. Install this plugin into a UDS docusaurus docs site
npm install --save @telus-uds/docusaurus-plugin-component-docs-pages
  1. Add the plugin to the docusaurus.config.js
module.exports = {
  // ...

  plugins: ['@telus-uds/docusaurus-plugin-component-docs-pages']

  // ...
}

Usage

This plugin wraps a docusaurus docs plugin with content automatically provided from the 'docs/' folder. The plugin accepts all options applicable to the docs plugin, and passes these through to the underlying docs plugin, altering only the sidebarPath to reflect the copied sidebar file.

Note 1: If you are using this as your only docs plugin and you are using the classic preset, you will need to disable docs in the preset.

Note 2: You will need to provide @theme/PropsTable @theme/Playground and @theme/LibraryInfo components in your docusaurus site for this plugin to work, you will also need to make all UDS Base components and at least an ExampleIcon available in the react live scope (see e.g. the Koodo docs site for how to do this).

module.exports = {
  // ...

  presets: [
    'classic',
    {
      docs: false,
      theme: {
        //...
      }
    }
  ],

  plugins: [
    '@telus-uds/docusaurus-plugin-component-docs-pages',
    {
      breadcrumbs: false
    }
  ]

  // ...
}

If you wish to use this plugin with a custom index page, just add a README.mdx to the directory which will contain the docs and add

slug: '/'
displayed_sidebar: generatedComponentsDocs

into the metadata.

Adding component docs

To add documentation for a component depending on a platform:

  1. Add a new MDX file with id matching the component name into respective platform web, multi-platform, ios inside docs/. If the platform you need does not exist create a respective folder for it in docs/.
  2. Add a sidebar file into sidebars/ with the same name as the destination folder. For eg: if shown below is your plugin options in docusaurus.config.js
;[
  '@telus-uds/docusaurus-plugin-component-docs-pages',
  {
    id: 'allium',
    path: 'components/allium',
    routeBasePath: 'components/allium',
    breadcrumbs: false
  }
]

You'll need an allium.js in sibebars with keys for each respective platform as shown below.

module.exports = {
  ios: {
    Inputs: ['ios/radio', 'ios/checkbox']
  },
  web: ['web/list', 'web/image']
}

Refer to the UDS monorepo README for details.

2.53.0

11 days ago

2.52.0

23 days ago

2.51.0

1 month ago

2.50.0

2 months ago

2.49.0

2 months ago

2.48.1

3 months ago

2.48.0

3 months ago

2.47.0

3 months ago

2.46.0

4 months ago

2.45.0

4 months ago

2.44.0

4 months ago

2.43.0

5 months ago

2.41.0

6 months ago

2.42.0

6 months ago

2.29.0

9 months ago

2.29.2

8 months ago

2.29.1

9 months ago

2.25.0

10 months ago

2.27.0

10 months ago

2.32.0

8 months ago

2.34.0

7 months ago

2.30.0

8 months ago

2.36.0

7 months ago

2.38.0

6 months ago

2.28.0

9 months ago

2.24.0

10 months ago

2.26.0

10 months ago

2.31.0

8 months ago

2.33.0

7 months ago

2.39.0

6 months ago

2.35.0

7 months ago

2.37.0

6 months ago

2.23.0

10 months ago

2.40.0

6 months ago

2.22.0

11 months ago

2.19.0

11 months ago

2.17.0

11 months ago

2.20.0

11 months ago

2.18.0

11 months ago

2.21.0

11 months ago

2.16.0

12 months ago

2.11.0

1 year ago

2.15.0

12 months ago

2.13.0

12 months ago

2.12.0

12 months ago

2.10.0

1 year ago

2.9.0

1 year ago

2.14.0

12 months ago

2.5.0

1 year ago

2.4.0

1 year ago

2.7.0

1 year ago

2.6.1

1 year ago

2.6.0

1 year ago

2.8.0

1 year ago

2.6.2

1 year ago

1.15.0

1 year ago

1.14.0

1 year ago

1.13.0

1 year ago

2.3.0

1 year ago

2.2.0

1 year ago

2.1.0

1 year ago

2.0.0

1 year ago

1.12.0

1 year ago

1.11.0

1 year ago

1.10.0

1 year ago

1.9.2

1 year ago

1.9.1

1 year ago

1.9.0

1 year ago

1.8.0

1 year ago

1.7.0

2 years ago

1.6.0

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.3.0

2 years ago

1.1.2

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

0.1.0

2 years ago

1.0.0

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.0.1

2 years ago