Skip to content

Commit

Permalink
Merge branch 'master' into react16
Browse files Browse the repository at this point in the history
* master:
  Refactor: Replace Markdown links with the Link component instead of the styles (#650)
  Docs: Clarify logging in Node API (#637)
  Docs: Correct the `static` modifier note (#643)
  Docs: Explain behavior for code blocks w/o language tag (#642)
  Docs: Fix invalid prop type warning (#639)
  Fix: Clear console on example reload (#638)
  Docs: Add credits for logo designers (#636)
  Fix: Update react-docgen (#635)
  Fix: Correctly print non-Styleguidist exception messages
  Fix: Fix validation error for uglifyjs-webpack-plugin
  Docs: Remove react-modal dependency, tweak examples
  Docs: Update react-styleguidist in CRA example (#632)

# Conflicts:
#	examples/basic/package-lock.json
#	examples/basic/package.json
#	examples/cra/package-lock.json
#	examples/customised/package-lock.json
#	examples/customised/package.json
#	examples/express/package-lock.json
#	examples/express/package.json
#	examples/sections/package-lock.json
#	examples/sections/package.json
#	examples/webpack/package-lock.json
#	examples/webpack/package.json
#	package-lock.json
#	package.json
  • Loading branch information
tizmagik committed Oct 24, 2017
2 parents a92f770 + 6a37b1d commit e6db3eb
Show file tree
Hide file tree
Showing 33 changed files with 33,114 additions and 889 deletions.
2 changes: 2 additions & 0 deletions Readme.md
Expand Up @@ -71,4 +71,6 @@ Everyone is welcome to contribute. Please take a moment to review the [contribut

[Artem Sapegin](http://sapegin.me) and [contributors](https://github.com/styleguidist/react-styleguidist/graphs/contributors).

Logo by @SaraVieira and @okonet

MIT License, see the included [License.md](License.md) file.
4 changes: 2 additions & 2 deletions bin/styleguidist.js
Expand Up @@ -27,9 +27,9 @@ process.on('uncaughtException', err => {
} else if (err instanceof StyleguidistError) {
console.error(chalk.bold.red(err.message));
logger.debug(err.stack);
process.exit(1);
} else {
throw err;
console.error(err.toString());
console.error(err.stack);
}
process.exit(1);
});
Expand Down
7 changes: 7 additions & 0 deletions docs/API.md
Expand Up @@ -18,6 +18,11 @@ Using a JavaScript object:
```javascript
const styleguidist = require('react-styleguidist');
const styleguide = styleguidist({
logger: {
warn: console.warn,
info: console.log,
debug: console.log,
},
components: './lib/components/**/*.js',
webpackConfig: {
module: {
Expand All @@ -37,6 +42,8 @@ const styleguide = styleguidist({
});
```

**Note:** any output is disabled by default, you may need to define your own [logger](Configuration.md#logger).

Using a config file:

```javascript
Expand Down
4 changes: 3 additions & 1 deletion docs/Documenting.md
Expand Up @@ -58,7 +58,7 @@ export default class Button extends React.Component {
## Usage examples and Readme files

Styleguidist will look for any `Readme.md` or `ComponentName.md` files in the component’s folder and display them. Any code block with a language tag of `js`, `jsx` or `javascript` will be rendered as a React component with an interactive playground.
Styleguidist will look for any `Readme.md` or `ComponentName.md` files in the component’s folder and display them. Any code block with a language tag of `js`, `jsx` or `javascript` will be rendered as a React component with an interactive playground. For backwards compatibility, code blocks without a language tag are also rendered in this way. It is recommended to always use the proper language tag for new documentation.

React component example:

Expand Down Expand Up @@ -94,6 +94,8 @@ Styleguidist will look for any `Readme.md` or `ComponentName.md` files in the co

> **Note:** You can configure examples file name with the [getExampleFilename](Configuration.md#getexamplefilename) option.
> **Note:** If you need to display some JavaScript code in your documentation that you don't want rendered as an interactive playground you can use the `static` modifier with a language tag (e.g. `js static`).
## External examples using doclet tags

Additional example files can be associated with components using `@example` doclet syntax.
Expand Down

0 comments on commit e6db3eb

Please sign in to comment.