Use docs/ComponentName.md at the end of the component docs

This commit is contained in:
Christopher Chedeau
2015-03-04 21:03:24 -08:00
parent d935f4554b
commit b9ab607197
3 changed files with 17 additions and 6 deletions

View File

@@ -19,9 +19,13 @@ function docsToMarkdown(filepath, i) {
docs.resolver.findAllReactCreateClassCalls(node, recast)[0];
}
);
var componentName = getNameFromPath(filepath);
var docFilePath = '../docs/' + componentName + '.md';
if (fs.existsSync(docFilePath)) {
json.fullDescription = fs.readFileSync(docFilePath).toString();
}
var res = [
'---',
'id: ' + slugify(componentName),
@@ -37,15 +41,16 @@ function docsToMarkdown(filepath, i) {
}
var components = [
'../Libraries/Components/Navigation/NavigatorIOS.ios.js',
'../Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js',
'../Libraries/Text/ExpandingText.js',
'../Libraries/Image/Image.ios.js',
'../Libraries/Components/ListView/ListView.js',
'../Libraries/Components/Navigation/NavigatorIOS.ios.js',
'../Libraries/Components/ScrollView/ScrollView.ios.js',
'../Libraries/Text/Text.js',
'../Libraries/Image/Image.ios.js',
'../Libraries/Components/TextInput/TextInput.ios.js',
'../Libraries/Components/Touchable/TouchableHighlight.js',
'../Libraries/Components/Touchable/TouchableOpacity.js',
'../Libraries/Components/Touchable/TouchableWithoutFeedback.js',
'../Libraries/Components/View/View.js',
];