diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index e66cdff2e7..7da24f0944 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,8 +2,6 @@ Thanks for submitting a pull request! Please provide enough information so that > **Unless you are a React Native release maintainer and cherry-picking an *existing* commit into a current release, ensure your pull request is targeting the `master` React Native branch.** -(You can skip this if you're fixing a typo or adding an app to the Showcase.) - Explain the **motivation** for making this change. What existing problem does the pull request solve? Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3c08db03db..53f7c5c889 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,7 +21,7 @@ The core team will be monitoring for pull requests. When we get one, we'll run s 1. Fork the repo and create your branch from `master`. 2. **Describe your test plan in your commit.** If you've added code that should be tested, add tests! 3. If you've changed APIs, update the documentation. -4. If you've updated the docs, verify the website locally and submit screenshots if applicable +4. If you've updated the docs, verify the website locally and submit screenshots if applicable. ``` $ cd website diff --git a/website/core/Footer.js b/website/core/Footer.js new file mode 100644 index 0000000000..516b178d64 --- /dev/null +++ b/website/core/Footer.js @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule Footer + */ + +var React = require('React'); + +function getGitHubPath(path) { + return 'https://github.com/facebook/react-native/blob/master/' + path; +} + +var Footer = React.createClass({ + render: function() { + return ( +

+ You can edit the content above on GitHub and send us a pull request! +

+ ); + } +}); + +module.exports = Footer; diff --git a/website/core/HeaderWithGithub.js b/website/core/HeaderWithGithub.js index 601051c7e3..c8e87770ce 100644 --- a/website/core/HeaderWithGithub.js +++ b/website/core/HeaderWithGithub.js @@ -12,13 +12,8 @@ var H = require('Header'); var React = require('React'); -function getVersionedGithubPath(path, version) { - version = version || 'next'; - return [ - 'https://github.com/facebook/react-native/blob', - version === 'next' ? 'master' : version + '-stable', - path - ].join('/'); +function getGitHubPath(path) { + return 'https://github.com/facebook/react-native/blob/master/' + path; } var HeaderWithGithub = React.createClass({ @@ -40,7 +35,7 @@ var HeaderWithGithub = React.createClass({ + href={getGitHubPath(this.props.path)}> Edit on GitHub diff --git a/website/layout/AutodocsLayout.js b/website/layout/AutodocsLayout.js index 33351016b0..7ff3280a80 100644 --- a/website/layout/AutodocsLayout.js +++ b/website/layout/AutodocsLayout.js @@ -12,9 +12,9 @@ 'use strict'; var DocsSidebar = require('DocsSidebar'); -var H = require('Header'); var Header = require('Header'); var HeaderWithGithub = require('HeaderWithGithub'); +var Footer = require('Footer'); var Marked = require('Marked'); var Prism = require('Prism'); var React = require('React'); @@ -331,7 +331,7 @@ var ComponentDoc = React.createClass({ } return ( - Methods +
Methods
{methods.filter((method) => { return method.name[0] !== '_'; @@ -362,7 +362,7 @@ var ComponentDoc = React.createClass({ } return ( - Type Definitions +
Type Definitions
{typedefs.map((typedef) => { return this.renderTypeDef(typedef, namedTypes); @@ -381,7 +381,7 @@ var ComponentDoc = React.createClass({ {content.description} - Props +
Props
{this.renderProps(content.props, content.composes)} {this.renderMethods(content.methods, namedTypes)} {this.renderTypeDefs(content.typedef, namedTypes)} @@ -413,7 +413,7 @@ var APIDoc = React.createClass({ } return ( - Methods +
Methods
{methods.filter((method) => { return method.name[0] !== '_'; @@ -447,7 +447,7 @@ var APIDoc = React.createClass({ } return ( - Properties +
Properties
{properties.filter((property) => { return property.name[0] !== '_'; @@ -508,7 +508,7 @@ var APIDoc = React.createClass({ } return ( - Type Definitions +
Type Definitions
{typedefs.map((typedef) => { return this.renderTypeDef(typedef, namedTypes); @@ -835,13 +835,11 @@ var Autodocs = React.createClass({ } return (
- +
Description
{docs.fullDescription} +
); }, @@ -876,7 +874,7 @@ var Autodocs = React.createClass({ return (
- {(docs.examples.length > 1) ? Examples : null} + {(docs.examples.length > 1) ?
Examples
: null} {docs.examples.map(example => this.renderExample(example, metadata))}
); @@ -895,12 +893,9 @@ var Autodocs = React.createClass({
- +
{metadata.title}
{content} +