Skip to content

Commit ad4c993

Browse files
committed
update project description
1 parent 1c2238d commit ad4c993

File tree

3 files changed

+56
-184
lines changed

3 files changed

+56
-184
lines changed

Changelog.md

Lines changed: 0 additions & 67 deletions
This file was deleted.

Readme.md

Lines changed: 39 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,54 @@
1-
# React Styleguidist :skull: work in progress :skull:
1+
# React Styleguidist Integration Plugin for SourceJS
22

3-
[![Build Status](https://travis-ci.org/sapegin/react-styleguidist.svg)](https://travis-ci.org/sapegin/react-styleguidist)
3+
[![Build Status](https://travis-ci.org/sourcejs/sourcejs-react-styleguidist.svg?branch=master)](https://travis-ci.org/sourcejs/sourcejs-react-styleguidist)
44

5-
React components style guide generator with a hot reloaded (style guide) dev server.
5+
Fork of React Style Guide generator [react-styleguidist](https://github.com/sapegin/react-styleguidist) with integration to [SourceJS](http://sourcejs.com) platform.
66

7-
[Example style guide](http://sapegin.github.io/react-styleguidist/).
7+
[Original styleguidist example](http://sapegin.github.io/react-styleguidist/).
8+
(example with SourceJS will be available later)
89

910
![](https://s3.amazonaws.com/f.cl.ly/items/3i0E1D1L1c1m1s2G1d0y/Screen%20Recording%202015-09-24%20at%2009.49%20AM.gif)
1011

12+
To add automatically generated React props docs use [sourcejs-react-docgen](https://github.com/sourcejs/sourcejs-react-docgen) plugin. Check [SourceJS React bundle example](http://github.com/sourcejs/react-styleguidist-example) for more insights.
13+
1114
## Installation
1215

1316
```
14-
npm install --save-dev react-styleguidist
17+
cd sourcejs-project
18+
npm install sourcejs-react-styleguidist --save
1519
```
1620

17-
Add a `styleguide.config.js` file into your project’s root folder:
21+
After re-running your SourceJS app, plugin will be loaded automatically.
22+
23+
### Important configs
24+
25+
Configure path to components in SourceJS `options.js` file:
1826

1927
```javascript
28+
var path = require('path');
29+
2030
module.exports = {
21-
rootDir: './lib',
22-
components: './components/**/*.js'
31+
plugins: {
32+
reactStyleguidist: {
33+
rootDir: path.join(global.userPath, 'specs'),
34+
components: './**/*.js'
35+
}
36+
}
2337
};
2438
```
2539

2640
See Configuration section below for the list of available options.
2741

28-
Add these scripts to your `package.json`:
29-
30-
```json
31-
"scripts": {
32-
"styleguide-server": "styleguidist server",
33-
"styleguide-build": "styleguidist build"
34-
},
35-
```
36-
37-
And run `npm run styleguide-server` to start styleguide dev server.
38-
3942
## Documenting components
4043

41-
Styleguidist generates documentation from 2 sources:
42-
43-
### PropTypes and component description
44-
45-
Components' `PropTypes` and documentation comments are parsed by the [react-docgen](https://github.com/reactjs/react-docgen) library. Have a look at [their example](https://github.com/reactjs/react-docgen#example) of a component documentation.
46-
47-
### Usage examples and further documentation
48-
49-
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.
44+
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.
5045

5146
```markdown
5247
React component example:
5348

54-
<Button size="large">Push Me</Button>
49+
&#96;``jsx
50+
<Button size="large">Push Me</Button>
51+
&#96;``
5552

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

@@ -62,14 +59,14 @@ Any [Markdown](http://daringfireball.net/projects/markdown/):
6259

6360
## Configuration
6461

65-
You can change some settings in the `styleguide.config.js` file in your project’s root folder.
62+
Use SourceJS `options.js` for deep plugin configuration.
6663

67-
* **`rootDir`**
68-
Type: `String`, required
69-
Your app’s frontend root folder (eg. `./lib`). Should not point to a folder with the Styleguidist config and `node_modules` folder.
64+
* **`rootDir`**
65+
Type: `String`, required
66+
Your components sources root folder (eg. `./lib`). Should not point to a folder with the `node_modules` folder.
7067

71-
* **`components`**
72-
Type: `String` or `Function`, required
68+
* **`components`**
69+
Type: `String` or `Function`, required
7370
- when `String`: a [glob pattern](https://github.com/isaacs/node-glob#glob-primer) that matches all your component modules. Relative to the `rootDir`.
7471
- when `Function`: function that returns an array of modules.
7572

@@ -89,44 +86,24 @@ You can change some settings in the `styleguide.config.js` file in your project
8986
},
9087
```
9188

92-
* **`styleguideDir`**
93-
Type: `String`, default: `styleguide`
94-
Folder for static HTML style guide generated with `styleguidist build` command.
95-
96-
* **`template`**
97-
Type: `String`, default: [src/templates/index.html](src/templates/index.html)
98-
HTML file to use as the template for the output.
99-
100-
* **`title`**
101-
Type: `String`, default: `Style guide`
102-
Style guide title.
103-
104-
* **`serverHost`**
105-
Type: `String`, default: `localhost`
106-
Dev server host name.
107-
108-
* **`serverPort`**
109-
Type: `Number`, default: `3000`
110-
Dev server port.
111-
112-
* **`highlightTheme`**
113-
Type: `String`, default: `base16-light`
89+
* **`highlightTheme`**
90+
Type: `String`, default: `base16-light`
11491
[CodeMirror theme](http://codemirror.net/demo/theme.html) name to use for syntax highlighting in examples.
11592

116-
* **`getExampleFilename`**
117-
Type: `Function`, default: finds `Readme.md` in the component folder
93+
* **`getExampleFilename`**
94+
Type: `Function`, default: finds `readme.md` in the component folder
11895
Function that returns examples file path for a given component path.
11996

120-
For example, instead of `Readme.md` you can use `ComponentName.examples.md`:
97+
For example, instead of `readme.md` you can use `ComponentName.examples.md`:
12198

12299
```javascript
123100
getExampleFilename: function(componentpath) {
124101
return componentpath.replace(/\.jsx?$/, '.examples.md');
125102
}
126103
```
127104

128-
* **`updateWebpackConfig`**
129-
Type: `Function`, optional
105+
* **`updateWebpackConfig`**
106+
Type: `Function`, optional
130107
Function that allows you to modify Webpack config for style guide:
131108

132109
```javascript
@@ -138,43 +115,10 @@ You can change some settings in the `styleguide.config.js` file in your project
138115
}
139116
```
140117

141-
### Config example
142-
143-
```javascript
144-
module.exports = {
145-
title: 'Style guide example',
146-
rootDir: './example',
147-
components: './**/*.js',
148-
getExampleFilename: function(componentpath) {
149-
return componentpath.replace(/\.js$/, '.examples.md');
150-
},
151-
};
152-
```
153-
154-
## CLI commands and options
155-
156-
`styleguidist server`: Run dev server.
157-
158-
`styleguidist build`: Generate a static HTML style guide.
159-
160-
### Options
161-
162-
* `--config`: Specify path to a config file: `styleguidist server --config dir/styleguide.config.js`.
163-
164-
* `--verbose`: Print debug information.
165-
166-
## Changelog
167-
168-
The changelog can be found in the [Changelog.md](Changelog.md) file.
169-
170118
## Contributing
171119

172120
Everyone is welcome to contribute. Please take a moment to review the [contributing guidelines](Contributing.md).
173121

174-
## Author
175-
176-
* [Artem Sapegin](http://sapegin.me)
177-
178122
---
179123

180124
## License

package.json

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,26 @@
11
{
2-
"name": "react-styleguidist",
3-
"description": "React components styleguide",
4-
"version": "1.1.1",
5-
"homepage": "https://github.com/sapegin/react-styleguidist",
6-
"author": {
7-
"name": "Artem Sapegin",
8-
"url": "http://sapegin.me/"
9-
},
2+
"name": "sourcejs-react-styleguidist",
3+
"description": "SourceJS integration plugin for react-styleuguidist",
4+
"version": "0.1.0",
5+
"homepage": "https://github.com/sourcejs/sourcejs-react-styleguidist",
6+
"contributirs": [
7+
{
8+
"name": "Artem Sapegin",
9+
"url": "http://sapegin.me/"
10+
},
11+
{
12+
"name": "Robert Haritonov",
13+
"url": "http://rhr.me/"
14+
}
15+
],
1016
"repository": {
1117
"type": "git",
12-
"url": "git://github.com/sapegin/react-styleguidist.git"
18+
"url": "git://github.com/sourcejs/sourcejs-react-styleguidist.git"
1319
},
1420
"bugs": {
15-
"url": "https://github.com/sapegin/react-styleguidist/issues"
21+
"url": "https://github.com/sourcejs/sourcejs-react-styleguidist/issues"
1622
},
1723
"license": "MIT",
18-
"main": "src/build.js",
19-
"bin": {
20-
"styleguidist": "bin/styleguidist"
21-
},
22-
"files": [
23-
"bin",
24-
"src",
25-
"loaders"
26-
],
2724
"engines": {
2825
"node": ">=0.12.0"
2926
},
@@ -39,15 +36,13 @@
3936
"extract-text-webpack-plugin": "0.8.2",
4037
"findup": "0.1.5",
4138
"glob": "5.0.15",
42-
"html-webpack-plugin": "1.6.2",
4339
"lodash": "3.10.1",
4440
"marked": "0.3.5",
4541
"minimist": "1.2.0",
4642
"postcss-advanced-variables": "1.2.2",
4743
"postcss-loader": "0.7.0",
4844
"prettyjson": "1.1.3",
4945
"react-codemirror": "0.1.7",
50-
"react-docgen": "2.3.1",
5146
"react-transform-catch-errors": "1.0.0",
5247
"react-transform-hmr": "1.0.1",
5348
"redbox-react": "1.1.1",
@@ -87,13 +82,13 @@
8782
"publish": "npm run build && gulp gh-pages"
8883
},
8984
"keywords": [
85+
"sourcejs",
9086
"react",
9187
"jsx",
9288
"styleguide",
9389
"style guide",
9490
"documentation",
9591
"docs",
96-
"generator",
9792
"component",
9893
"components"
9994
]

0 commit comments

Comments
 (0)