Skip to content

Commit

Permalink
add auto generated react doc
Browse files Browse the repository at this point in the history
  • Loading branch information
robhrt7 committed Oct 6, 2015
1 parent e336de6 commit b3ffcc5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-styleguide-example",
"version": "0.1.0",
"version": "0.2.0",
"description": "Example of react-styleguide usage.",
"main": "src/index.jsx",
"author": "Robert Haritonov <[email protected]>",
Expand All @@ -11,8 +11,9 @@
},
"dependencies": {
"react": "^0.13.3",
"sourcejs": "^0.6.0-nightly.0",
"sourcejs": "^0.6.0-nightly.1",
"sourcejs-react": "operatino/sourcejs-react",
"sourcejs-webpack": "^0.1.0"
"sourcejs-react-docgen": "^0.1.0",
"sourcejs-webpack": "^0.2.0"
}
}
6 changes: 6 additions & 0 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

var React = require('react/addons');

/**
* General component description. Defined in component's code (like JSDoc).
*/
module.exports = React.createClass({
propTypes: {
/**
* Description of prop "modifier".
*/
modifier: React.PropTypes.string
},
getDefaultProps: function getDefaultProps() {
Expand Down
4 changes: 4 additions & 0 deletions styleguide.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ module.exports = React.createClass({
<Section>
<h2>Default</h2>

<p><%- info.__docGenRaw.description %></p>

<%- info.__docGenHTML %>

<Code>
{`<Button>Button Text</Button>`}
</Code>
Expand Down

0 comments on commit b3ffcc5

Please sign in to comment.