A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/sourcejs/sourcejs-react-styleguidist below:

sourcejs/sourcejs-react-styleguidist: React Styleguidist Integration Plugin for SourceJS

React Styleguidist Integration Plugin for SourceJS

Fork of React Style Guide generator react-styleguidist with integration to SourceJS platform.

Original styleguidist example. (example with SourceJS will be available later)

To add automatically generated React props docs use sourcejs-react-docgen plugin. Check SourceJS React bundle example for more insights.

cd sourcejs-project
npm install sourcejs-react-styleguidist --save

Add custom markdown renderer conf into SourceJS options.js file:

module.exports = {
	core: {
        processMd: {
            languageRenderers: {
                jsx: require('sourcejs-react-styleguidist/core/lang-jsx').processExample
            }
        }
    }
};

After re-running your SourceJS app, plugin will be loaded automatically.

Configure path to components in SourceJS options.js file:

module.exports = {
	plugins: {
		reactStyleguidist: {
			rootDir: './relative/path/to/components',
			components: './**/*.jsx'
		}
	}
};

See Configuration section below for the list of available options.

Examples are written in Markdown where any code blocks will be rendered as a react components. By default any readme.md in the component folder is treated as an examples file but you can change it with the getExampleFilename option.

React component example:

```jsx
<Button size="large">Push Me</Button>
```

Any [Markdown](http://daringfireball.net/projects/markdown/):

* Foo;
* bar;
* baz.

SourceJS plugins are loaded together with main application, adding additional initialization steps or changing rendering flow using middleware integration. With this plugin, in development mode, SourceJS in enhanced with webpack middleware, that builds all the React examples on demand and listens to file changes for hot-reloading.

In production mode webpack is not triggered, expecting that bundle is already built (read configuration section for more).

Rendering flow with this plugins looks like this:

Use SourceJS options.js for deep plugin configuration.

Running app with NODE_ENV=production, initial webpack build won't be triggered. To properly prepare production environment, first run react-styleguidist build command, and only after that run application:

NODE_ENV=production node ./node_modules/sourcejs-react-styleguidist/core/build.js
NODE_ENV=production npm start

Note: this command should be ran from SourceJS root folder, where node_modules is placed.

Alternatively, you can set preBuild to true in plugin configuration, to build webpack bundle once app is ran in production mode. This will require less build steps, but may cause higher load in production environment container.

Everyone is welcome to contribute. Please take a moment to review the contributing guidelines.

The MIT License, see the included license.md file.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4