Skip to content

Commit e6db3eb

Browse files
committed
Merge branch 'master' into react16
* 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
2 parents a92f770 + 6a37b1d commit e6db3eb

33 files changed

+33114
-889
lines changed

Readme.md

+2
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,6 @@ Everyone is welcome to contribute. Please take a moment to review the [contribut
7171

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

74+
Logo by @SaraVieira and @okonet
75+
7476
MIT License, see the included [License.md](License.md) file.

bin/styleguidist.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ process.on('uncaughtException', err => {
2727
} else if (err instanceof StyleguidistError) {
2828
console.error(chalk.bold.red(err.message));
2929
logger.debug(err.stack);
30-
process.exit(1);
3130
} else {
32-
throw err;
31+
console.error(err.toString());
32+
console.error(err.stack);
3333
}
3434
process.exit(1);
3535
});

docs/API.md

+7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ Using a JavaScript object:
1818
```javascript
1919
const styleguidist = require('react-styleguidist');
2020
const styleguide = styleguidist({
21+
logger: {
22+
warn: console.warn,
23+
info: console.log,
24+
debug: console.log,
25+
},
2126
components: './lib/components/**/*.js',
2227
webpackConfig: {
2328
module: {
@@ -37,6 +42,8 @@ const styleguide = styleguidist({
3742
});
3843
```
3944

45+
**Note:** any output is disabled by default, you may need to define your own [logger](Configuration.md#logger).
46+
4047
Using a config file:
4148

4249
```javascript

docs/Documenting.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default class Button extends React.Component {
5858
5959
## Usage examples and Readme files
6060

61-
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.
61+
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.
6262

6363
React component example:
6464

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

9595
> **Note:** You can configure examples file name with the [getExampleFilename](Configuration.md#getexamplefilename) option.
9696
97+
> **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`).
98+
9799
## External examples using doclet tags
98100

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

0 commit comments

Comments
 (0)