Update installation documentation to use the init script (#200)

This commit is contained in:
Joel Marcey 2017-10-31 09:23:48 -07:00 committed by GitHub
parent 893a6e85b5
commit 8123acf2d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,30 +3,33 @@ id: installation
title: Installation
---
Docusaurus was designed from the ground up to be easily installed and used to get your website up an running quickly. To install Docusaurus, follow these steps:
Docusaurus was designed from the ground up to be easily installed and used to get your website up an running quickly. To install Docusaurus, we have created an easy script that will get all of the infrastructure setup for you:
1. Create a `website` folder in the root of your GitHub repo.
1. `cd website`
1. Create a `package.json` file with the following scripts that will be used when developing documentation with Docusaurus:
1. Go into the root of your GitHub repo directory where you will be creating the docs.
1. `yarn global add docusaurus-init` or `npm install --global docusaurus-init`
1. `docusaurus-init`
```json
{
"scripts": {
"start": "docusaurus-start",
"build": "docusaurus-build",
"publish-gh-pages": "docusaurus-publish",
"examples": "docusaurus-examples"
}
}
```
1. Install Docusaurus with `yarn` or `npm`
Along with previously existing files and directories, your root directory will now contain a structure similar to:
```
yarn add docusaurus -dev
```
```bash
root-of-repo
├── docs-examples-from-docusaurus
│ └── doc1.md
│ └── doc2.md
│ └── doc3.md
│ └── exampledoc4.md
│ └── exampledoc5.md
└── website
│ └── blog-examples-from-docusaurus
│ └── 2016-03-11-blog-post.md
│ └── 2017-04-10-blog-post-two.md
│ └── core
│ └── node_modules
│ └── package.json
│ └── pages
│ └── sidebars.json
│ └── siteConfig.js
│ └── static
```
or
```
npm install --save-dev docusaurus
```
> If you do not want to install the init script globally, you can install it locally and then run it from the `node_modules` directory that is created via `./node_modules/.bin/docusaurus-init`. You may want to remove the created `package.json` file and `node_modules` directory after you run the script.