Skip to content

Commit b9ab607

Browse files
committed
Use docs/ComponentName.md at the end of the component docs
1 parent d935f45 commit b9ab607

3 files changed

Lines changed: 17 additions & 6 deletions

File tree

website/core/Marked.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,9 @@ marked.parse = marked;
10851085

10861086
var Marked = React.createClass({
10871087
render: function() {
1088-
return React.DOM.div(null, marked(this.props.children, this.props));
1088+
return this.props.children ?
1089+
React.DOM.div(null, marked(this.props.children, this.props)) :
1090+
null;
10891091
}
10901092
});
10911093

website/layout/AutodocsLayout.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ var Autodocs = React.createClass({
1717
<Header level={4} className="propTitle" toSlug={name}>
1818
{name}
1919
{' '}
20-
<span className="propType">{prop.type.name}</span></Header>
21-
<Marked>{prop.description}</Marked>
20+
{prop.type && <span className="propType">{prop.type.name}</span>}
21+
</Header>
22+
{prop.description && <Marked>{prop.description}</Marked>}
2223
</div>
2324
);
2425
},
@@ -43,6 +44,9 @@ var Autodocs = React.createClass({
4344
{content.description}
4445
</Marked>
4546
{this.renderProps(content.props)}
47+
<Marked>
48+
{content.fullDescription}
49+
</Marked>
4650
<div className="docs-prevnext">
4751
{metadata.previous && <a className="docs-prev" href={metadata.previous + '.html#content'}>&larr; Prev</a>}
4852
{metadata.next && <a className="docs-next" href={metadata.next + '.html#content'}>Next &rarr;</a>}

website/server/extractDocs.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ function docsToMarkdown(filepath, i) {
1919
docs.resolver.findAllReactCreateClassCalls(node, recast)[0];
2020
}
2121
);
22-
2322
var componentName = getNameFromPath(filepath);
2423

24+
var docFilePath = '../docs/' + componentName + '.md';
25+
if (fs.existsSync(docFilePath)) {
26+
json.fullDescription = fs.readFileSync(docFilePath).toString();
27+
}
28+
2529
var res = [
2630
'---',
2731
'id: ' + slugify(componentName),
@@ -37,15 +41,16 @@ function docsToMarkdown(filepath, i) {
3741
}
3842

3943
var components = [
40-
'../Libraries/Components/Navigation/NavigatorIOS.ios.js',
44+
'../Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js',
45+
'../Libraries/Text/ExpandingText.js',
4146
'../Libraries/Image/Image.ios.js',
4247
'../Libraries/Components/ListView/ListView.js',
4348
'../Libraries/Components/Navigation/NavigatorIOS.ios.js',
4449
'../Libraries/Components/ScrollView/ScrollView.ios.js',
4550
'../Libraries/Text/Text.js',
46-
'../Libraries/Image/Image.ios.js',
4751
'../Libraries/Components/TextInput/TextInput.ios.js',
4852
'../Libraries/Components/Touchable/TouchableHighlight.js',
53+
'../Libraries/Components/Touchable/TouchableOpacity.js',
4954
'../Libraries/Components/Touchable/TouchableWithoutFeedback.js',
5055
'../Libraries/Components/View/View.js',
5156
];

0 commit comments

Comments
 (0)