Skip to content

Commit

Permalink
Improve docs (#168, #163).
Browse files Browse the repository at this point in the history
1. Note that it should work in Webpack 2.
2. Clarify skipComponentsWithoutExample option.
3. Two new FAQ items.
  • Loading branch information
sapegin committed Aug 18, 2016
1 parent ca65a81 commit 7c1c4e5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ You can change settings in the `styleguide.config.js` file in your project’s r

* **`skipComponentsWithoutExample`**<br>
Type: `Boolean`, default: `false`<br>
Ignore components that don’t have an example file (as determined by `getExampleFilename`).
Ignore components that don’t have an example file (as determined by `getExampleFilename`). These components won’t be accessible from other examples unless you manually `require` them.

* **`defaultExample`**<br>
Type: `Boolean` or `String`, default: `false`<br>
Expand Down
23 changes: 23 additions & 0 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,29 @@ let textarea;
</div>
```

## How to exclude some components from style guide?

Filter them out in the `components` option:

```javascript
components: function() {
return glob.sync(path.resolve(__dirname, 'lib/components/**/*.js')).filter(function(module) {
return !/\/(foo|bar).js$/.test(module); // Ignore foo.js and bar.js
});
},
```

## How to hide some components in style guide but make them available in examples?

Enable [skipComponentsWithoutExample](Configuration.md) option and do not add example file (`Readme.md` by default) to components you want to ignore.

Require these components in your examples:

```javascript
const Button = require('../common/Button');
<Button>Push Me Tender</Button>
```

## How to add custom JS and CSS?

Add a new Webpack entry point. In your style guide config:
Expand Down
2 changes: 1 addition & 1 deletion docs/GettingStarted.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Installation

**Requirements:** Only Babel 6 is supported in [Styleguidist 2.0.0](https://github.com/sapegin/react-styleguidist/releases/tag/2.0.0)+. If you don't use Babel in your project, that's fine, but if you use Babel 5, please use Styleguidist 1.3.2. Webpack is recommended, but not required.
**Requirements:** Only Babel 6 is supported in [Styleguidist 2.0.0](https://github.com/sapegin/react-styleguidist/releases/tag/2.0.0)+. If you don't use Babel in your project, that's fine, but if you use Babel 5, please use Styleguidist 1.3.2. Webpack is recommended, but not required. Should work with Webpack 1 and Webpack 2.

1. Install from npm:

Expand Down

0 comments on commit 7c1c4e5

Please sign in to comment.