Skip to content

Commit 5654d7b

Browse files
committed
[docs] Improve and provide clear installation instructions
1 parent af794b0 commit 5654d7b

File tree

3 files changed

+120
-55
lines changed

3 files changed

+120
-55
lines changed

README.md

+16-12
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,22 @@ resources for others to make use of.
2727
If you plan to contribute, then you may wish to setup a local development
2828
environment to make it easier to do so.
2929

30-
We highly recommend that you read our [documentation contributions guide](https://moodledev.io/general/documentation/contributing), which includes important information on [getting started](https://moodledev.io/general/documentation/contributing#development).
30+
We highly recommend that you read our [documentation contributions guide](https://moodledev.io/general/documentation/contributing), which includes important information on [getting started](https://moodledev.io/general/documentation/contributing#getting-started).
31+
32+
### Installation
33+
34+
For more information on the installation process see our [installation documentation](https://moodledev.io/general/documentation/installation), but if you want to jump right in then the easiest way is using [NVM](https://github.com/nvm-sh/nvm) and then running:
35+
36+
```
37+
nvm install
38+
npm i -g yarn
39+
yarn
40+
yarn start
41+
```
3142

3243
### Building your content
3344

34-
During development you will almost certainly want to use the yarn development
35-
server, however you will sometimes need to build the content to use certain
45+
During development you will almost certainly want to use the yarn development server, however you will sometimes need to build the content to use certain
3646
features.
3747

3848
This is easily achieved with yarn:
@@ -41,15 +51,9 @@ This is easily achieved with yarn:
4151
yarn build
4252
```
4353

44-
This command will compile all of the documentation into static HTML files
45-
complete with all appropriate resources.
54+
This command will compile all of the documentation into static HTML files complete with all appropriate resources.
4655

47-
As part of this build, the validity of all internal links will be checked. For
48-
this reason we strongly recommend building the content locally before submitting
49-
a pull request as broken internal links will lead to a build failure
56+
As part of this build, the validity of all internal links will be checked. For this reason we strongly recommend building the content locally before submitting a pull request as broken internal links will lead to a build failure
5057
immediately.
5158

52-
You may also need to configure the build to view it locally. This can be
53-
achieved using a `.env` file in the project root.
54-
For more information on the format of the `.env` file, see the documentation in
55-
the `.env.default` file.
59+
You may also need to configure the build to view it locally. This can be achieved using a `.env` file in the project root. For more information on the format of the `.env` file, see the documentation in the `.env.default` file.

general/documentation/contributing.md

+18-43
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,23 @@ Anyone can get involved with, and add to, these resources - you don't have to be
3333

3434
If you need help, please reach out to us and we will do our best to advise you.
3535

36+
## Getting started
37+
38+
Our documentation is built using [Docusaurus](https://docusarus.io), a powerful open source documentation project written in JavaScript. For more detailed information, see our [installation guide](./installation.md) to install your development environment and get started.
39+
40+
:::tip
41+
42+
If you're eager to jump in, then the fastest way to set up your development environment is to have [NVM](https://github.com/nvm-sh/nvm) installed and then run:
43+
44+
```console
45+
nvm install
46+
npm i -g yarn
47+
yarn
48+
yarn start
49+
```
50+
51+
:::
52+
3653
### Migrating legacy docs
3754

3855
We are currently migrating documentation from our [legacy documentation site](https://docs.moodle.org/dev), and one of the best ways to contribute with documentation is to help with this migration process.
@@ -160,48 +177,6 @@ If you only wish to make a small change, you may want to use the [GitHub Edit in
160177

161178
## Development
162179

163-
Our documentation is built using [Docusaurus](https://docusarus.io), a powerful open source documentation project written in JavaScript.
164-
165-
It's easy to get your development environment set up using [Yarn](https://yarnpkg.com/), and we we recommend that you use [NVM](https://github.com/nvm-sh/nvm) for your NodeJS version management. You can check our [.nvmrc](https://github.com/moodle/devdocs/blob/main/.nvmrc) for the best version of NodeJS to use.
166-
167-
We also have a [Gitpod](#Quick-start-with-Gitpod) configuration if you want to jump straight in and have a go
168-
169-
### Installation
170-
171-
If you contribute regularly to our documentation, then we recommend you setup a local development environment for the best results.
172-
173-
To set up a local development environment:
174-
175-
1. Ensure you have:
176-
1. [NVM](https://github.com/nvm-sh/nvm)
177-
1. The most appropriate version of NodeJS by running `nvm install`
178-
1. [Yarn](https://yarnpkg.com/)
179-
1. After cloning the repository, run `yarn install` in the root of the repository. This will install all dependencies as well as build all local packages.
180-
1. To start a development server, run `yarn start`.
181-
182-
### Quick start with Gitpod
183-
184-
Gitpod is a free, cloud-based, development environment providing VS Code and a suitable development environment right in your browser.
185-
186-
By [launching your workspace](https://gitpod.io/#https://github.com/moodle/devdocs) you can automatically:
187-
188-
- clone our devdocs repo
189-
- install all dependencies
190-
- run `yarn start`
191-
192-
You can write and preview your contributions from right within your browser, and
193-
even commit them and create a pull request.
194-
195-
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/moodle/devdocs)
196-
197-
GitHub has also launched their own lightweight online editor which integrates tightly with GitHub. Take a look at [github.dev](https://github.dev/moodle/devdocs).
198-
199-
:::info
200-
201-
Gitpod is an alternative to local development and completely optional. We recommend [setting up a local development environment](#installation) if you plan to contribute regularly.
202-
203-
:::
204-
205180
### Style guidelines
206181

207182
A set of writing and coding style guidelines for this documentation will be documented in more detail in the [style guides](./style-guides.md).
@@ -212,7 +187,7 @@ See our [linting and spelling](./linting.md) documentation for more information
212187

213188
:::
214189

215-
## Pull Requests
190+
### Pull Requests
216191

217192
All pull requests should be opened against the `main` branch, and pushed to your own GitHub fork of the repository.
218193

general/documentation/installation.md

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
title: Installation
3+
description: Information on how to install dependencies to start your development
4+
tags:
5+
- contributing
6+
- documentation
7+
- guide
8+
- installation
9+
- getting started
10+
- quick start
11+
sidebar_position: 3
12+
---
13+
14+
Our documentation is built using [Docusaurus](https://docusarus.io), a powerful open source documentation project written in JavaScript.
15+
16+
It's easy to get your development environment set up and if you plan to contribute regularly to our documentation, then we recommend you setup a [local development environment](#local-development) for the best results. If you're only planning to contribute as a once-off then you may want to consider trying [Gitpod](#quick-start-with-gitpod).
17+
18+
## Installation
19+
20+
### Local development
21+
22+
To set up a local development environment we recommend install [NVM](https://github.com/nvm-sh/nvm), and then running:
23+
24+
```console
25+
nvm install
26+
npm i -g yarn
27+
yarn
28+
```
29+
30+
:::note
31+
32+
From time to time you may need to repeat this process as we update the NodeJS version requirements or add dependencies.
33+
34+
:::
35+
36+
### Quick start with Gitpod
37+
38+
Gitpod is a free, cloud-based, development environment providing VS Code and a suitable development environment right in your browser.
39+
40+
By [launching your workspace](https://gitpod.io/#https://github.com/moodle/devdocs) you can automatically:
41+
42+
- clone our devdocs repo
43+
- install all dependencies
44+
- run `yarn start`
45+
46+
You can write and preview your contributions from right within your browser, and
47+
even commit them and create a pull request.
48+
49+
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/moodle/devdocs)
50+
51+
GitHub has also launched their own lightweight online editor which integrates tightly with GitHub. Take a look at [github.dev](https://github.dev/moodle/devdocs).
52+
53+
:::info
54+
55+
Gitpod is an alternative to local development and completely optional. We recommend [setting up a local development environment](#installation) if you plan to contribute regularly.
56+
57+
:::
58+
59+
## Useful commands
60+
61+
### Starting the development server
62+
63+
```console
64+
yarn start
65+
```
66+
67+
### Building the docs and serving them locally
68+
69+
```console
70+
yarn build
71+
yarn serve
72+
```
73+
74+
### Migrating a document
75+
76+
For full documentation on document migration see the [notes on contributing](./contributing.md#migrating-legacy-docs)
77+
78+
```console
79+
yarn migrate [https://docs.moodle.org/dev/Old_doc_location] [newLocation]
80+
```
81+
82+
### Linting documents
83+
84+
```console
85+
yarn mdlint-all
86+
```

0 commit comments

Comments
 (0)