diff --git a/website/layout/AutodocsLayout.js b/website/layout/AutodocsLayout.js index 8f356b5d9..e273a4ec8 100644 --- a/website/layout/AutodocsLayout.js +++ b/website/layout/AutodocsLayout.js @@ -145,7 +145,11 @@ var ComponentDoc = React.createClass({ {content.description} - Props + + {this.renderProps(content.props, content.composes)} ); @@ -248,7 +252,39 @@ var APIDoc = React.createClass({ } }); +var HeaderWithGithub = React.createClass({ + render: function() { + return ( + + + Edit on GitHub + + {this.props.title} + + ); + } +}); + var Autodocs = React.createClass({ + renderFullDescription: function(docs) { + if (!docs.fullDescription) { + return; + } + return ( +
+ + + {docs.fullDescription} + +
+ ); + }, + render: function() { var metadata = this.props.metadata; var docs = JSON.parse(this.props.children); @@ -264,9 +300,7 @@ var Autodocs = React.createClass({

{metadata.title}

{content} - - {docs.fullDescription} - + {this.renderFullDescription(docs)}
{metadata.previous && ← Prev} {metadata.next && Next →} diff --git a/website/server/extractDocs.js b/website/server/extractDocs.js index 78fa14d83..5fd1f1195 100644 --- a/website/server/extractDocs.js +++ b/website/server/extractDocs.js @@ -33,6 +33,8 @@ function componentsToMarkdown(type, json, filepath, i, styles) { json.fullDescription = fs.readFileSync(docFilePath).toString(); } json.type = type; + json.filepath = filepath.replace(/^\.\.\//, ''); + json.componentName = componentName; if (styles) { json.styles = styles; } diff --git a/website/src/react-native/css/react-native.css b/website/src/react-native/css/react-native.css index ec8e8e15a..e11863ab2 100644 --- a/website/src/react-native/css/react-native.css +++ b/website/src/react-native/css/react-native.css @@ -964,6 +964,11 @@ div[data-twttr-id] iframe { font-size: 13px; } +.edit-github { + font-size: 15px; + font-weight: normal; + float: right; +} #content { display: none;