Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5238 set up basic docs structure #5245

Merged
merged 10 commits into from
Oct 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docusaurus/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Nothing to see here right now

Please refer to the [Readme](https://github.com/facebook/create-react-app/blob/master/README.md) or the [User Guide](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md).
119 changes: 119 additions & 0 deletions docusaurus/docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
---
id: getting-started
title: Getting started
sidebar_label: Getting started
---

## Quick Overview

```sh
npx create-react-app my-app
cd my-app
npm start
```

_([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f))_

Then open [http://localhost:3000/](http://localhost:3000/) to see your app.<br>
When you’re ready to deploy to production, create a minified bundle with `npm run build`.

<p align='center'>
<img src='https://cdn.rawgit.com/facebook/create-react-app/27b42ac/screencast.svg' width='600' alt='npm start'>
</p>

### Get Started Immediately

You **don’t** need to install or configure tools like Webpack or Babel.<br>
They are preconfigured and hidden so that you can focus on the code.

Just create a project, and you’re good to go.

## Creating an App

**You’ll need to have Node >= 6 on your local development machine** (but it’s not required on the server). You can use [nvm](https://github.com/creationix/nvm#installation) (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to easily switch Node versions between different projects.

To create a new app, you may choose one of the following methods:

### npx

```sh
npx create-react-app my-app
```

_([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f))_

### npm

```sh
npm init react-app my-app
```

_`npm init <initializer>` is available in npm 6+_

### Yarn

```sh
yarn create react-app my-app
```

_`yarn create` is available in Yarn 0.25+_

It will create a directory called `my-app` inside the current folder.<br>
Inside that directory, it will generate the initial project structure and install the transitive dependencies:

```
my-app
├── README.md
├── node_modules
├── package.json
├── .gitignore
├── public
│ ├── favicon.ico
│ ├── index.html
│ └── manifest.json
└── src
├── App.css
├── App.js
├── App.test.js
├── index.css
├── index.js
├── logo.svg
└── registerServiceWorker.js
```

No configuration or complicated folder structures, just the files you need to build your app.<br>
Once the installation is done, you can open your project folder:

```sh
cd my-app
```

Inside the newly created project, you can run some built-in commands:

### `npm start` or `yarn start`

Runs the app in development mode.<br>
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will automatically reload if you make changes to the code.<br>
You will see the build errors and lint warnings in the console.

<p align='center'>
<img src='https://cdn.rawgit.com/marionebl/create-react-app/9f62826/screencast-error.svg' width='600' alt='Build errors'>
</p>

### `npm test` or `yarn test`

Runs the test watcher in an interactive mode.<br>
By default, runs tests related to files changed since the last commit.

[Read more about testing.](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#running-tests)

### `npm run build` or `yarn build`

Builds the app for production to the `build` folder.<br>
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.<br>

Your app is ready to be deployed.
7 changes: 7 additions & 0 deletions docusaurus/docs/user-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
id: user-guide
title: User guide
sidebar_label: User guide
---

The user guide can be found on [GitHub](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md) for now.
File renamed without changes.
8 changes: 4 additions & 4 deletions website/core/Footer.js → docusaurus/website/core/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ class Footer extends React.Component {
</a>
<div>
<h5>Docs</h5>
<a href={this.docUrl('doc1.html', this.props.language)}>
Getting Started (or other categories)
<a href={this.docUrl('getting-started', this.props.language)}>
Getting Started
</a>
<a href={this.docUrl('doc2.html', this.props.language)}>
Guides (or other categories)
<a href={this.docUrl('user-guide', this.props.language)}>
User Guide
</a>
<a href={this.docUrl('doc3.html', this.props.language)}>
API Reference (or other categories)
Expand Down
22 changes: 16 additions & 6 deletions website/i18n/en.json → docusaurus/website/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,26 @@
"next": "Next",
"previous": "Previous",
"tagline": "Create React apps with no build configuration.",
"docs": {},
"docs": {
"getting-started": {
"title": "Getting started",
"sidebar_label": "Getting started"
},
"README": {
"title": "README"
},
"user-guide": {
"title": "User guide",
"sidebar_label": "User guide"
}
},
"links": {
"Docs": "Docs",
"API": "API",
"Getting started": "Getting started",
"Help": "Help"
},
"categories": {
"Docusaurus": "Docusaurus",
"First Category": "First Category",
"Second Category": "Second Category"
"Getting Started": "Getting Started",
"User Guide": "User Guide"
}
},
"pages-strings": {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ class HomeSplash extends React.Component {
<ProjectTitle />
<PromoSection>
<Button href="#try">Try It Out</Button>
<Button href={docUrl('doc1.html', language)}>Example Link</Button>
<Button href={docUrl('doc2.html', language)}>Example Link 2</Button>
<Button href={docUrl('getting-started', language)}>
Get started
</Button>
<Button href={docUrl('user-guide', language)}>User guide</Button>
</PromoSection>
</div>
</SplashContainer>
Expand Down
6 changes: 6 additions & 0 deletions docusaurus/website/sidebars.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"docs": {
"Getting Started": ["getting-started"],
"User Guide": ["user-guide"]
}
}
3 changes: 1 addition & 2 deletions website/siteConfig.js → docusaurus/website/siteConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ const siteConfig = {

// For no header links in the top nav bar -> headerLinks: [],
headerLinks: [
{ doc: 'doc1', label: 'Docs' },
{ doc: 'doc4', label: 'API' },
{ doc: 'getting-started', label: 'Getting started' },
{ href: 'https://reactjs.org/community/support.html', label: 'Help' },
],

Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 0 additions & 10 deletions website/sidebars.json

This file was deleted.