|
| 1 | +<!-- Generated by documentation.js. Update this documentation by updating the source code. --> |
| 2 | + |
| 3 | +## createConfig |
| 4 | + |
| 5 | +You need to import `createConfig` into your [react-styleguidist][1] configuration file (generally `styleguide.config.js`). |
| 6 | +All options are optional, and can be autoconfigured by installing a [layout package][2]. |
| 7 | + |
| 8 | +### Parameters |
| 9 | + |
| 10 | +- `config` **[Object][3]** for react-styleguidist user configuration, it will be used to override our default styleguide configuration. See [https://react-styleguidist.js.org/docs/configuration.html][4] (optional, default `{}`) |
| 11 | +- `options` **[Object][3]** for $PACKAGE_NAME features (optional, default `{}`) |
| 12 | + - `options.layout` **[string][5]** options.layout - Name of the layout package (optional, default `''`) |
| 13 | + - `options.layoutPath` **[string][5]** options.layoutPath - Location of the Layout component within the layout package (optional, default `lib/Layout`) |
| 14 | + - `options.wrapperPath` **[string][5]** options.wrapperPath - Location of the Wrapper component within the layout package (optional, default `lib/Wrapper`) |
| 15 | + - `options.selectionConfigPath` **[string][5]** options.selectionConfigPath - Location of the styleguide.config.js within the layout package (optional, default `lib/styleguide.config.js`) |
| 16 | + - `options.loadersConfigPath` **[string][5]** options.loadersConfigPath - Location of the loaders within the layout package (optional, default `lib/loaders`) |
| 17 | + - `options.styleGuideDirPath` **[string][5]** options.styleGuideDirPath - Location of the styleguide configuration directory within your project (optional, default `styleguide`) |
| 18 | + - `options.extensionFile` **[string][5]** options.extensionFile - Name of the styleguide configuration extension within your project (optional, default `styleguide.ext.json`) |
| 19 | + - `options.setupFile` **[string][5]** options.setupFile - Name of the setup file within your project (optional, default `setup.js`) |
| 20 | + - `options.licensePath` **[string][5]** options.licensePath - Location of the license within your project (optional, default `LICENSE.md`) |
| 21 | + - `options.locale` **[string][5]** options.locale - Locale used for the documentation (optional, default `en`) |
| 22 | + - `options.loader` **[string][5]** options.loader - Loader to be used for the documentation (optional, default `wave`) |
| 23 | + - `options.loaders` **[Object][3]** options.loaders - object available for use (if layout package is installed, they will be automatically added during autoconfiguration) (optional, default `{wave:'<!-- content of wave loader >'}`) |
| 24 | + - `options.loaderInnerApp` **[boolean][6]** options.loaderInnerApp - If set to false, the loader will be injected in the main html outside of the react application context (optional, default `true`) |
| 25 | + - `options.favicon` **[string][5]** options.favicon - Favicon href url (optional, default `null`) |
| 26 | + - `options.head` **[string][5]** options.head - This will be injected at the end of <head /> tag (optional, default `null`) |
| 27 | + - `options.disableAutoConf` **[boolean][6]** option.disableAutoConf - Disable auto configuration of layout package (optional, default `false`) |
| 28 | + |
| 29 | +### Examples |
| 30 | + |
| 31 | +```js static |
| 32 | +// Choose manually a layout package and expand example by default |
| 33 | +const { createConfig } = require('$PACKAGE_NAME'); |
| 34 | +const styleguideConfig = { exampleMode: 'expand' }; |
| 35 | +const options = { layout: '@bootstrap-styled/documentation' }; |
| 36 | +const config = createConfig(styleguideConfig, options); |
| 37 | +// this is a working and compatible react-styleguidist configuration |
| 38 | +module.exports = config; |
| 39 | +``` |
| 40 | + |
| 41 | +Returns **[Object][3]** react-styleguidist [configuration][4] configuration object |
| 42 | + |
| 43 | +[1]: https://react-styleguidist.js.org |
| 44 | + |
| 45 | +[2]: #layout-package-create |
| 46 | + |
| 47 | +[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object |
| 48 | + |
| 49 | +[4]: https://react-styleguidist.js.org/docs/configuration.html |
| 50 | + |
| 51 | +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String |
| 52 | + |
| 53 | +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean |
0 commit comments