meshtastic/docs/developers/maintaining-documentation/serve-docs-locally.md

92 lines
2.4 KiB
Markdown
Raw Normal View History

2022-01-31 09:09:37 -08:00
---
id: serve-docs-locally
title: Setting up Local Documentation
sidebar_label: Serve Docs Locally
---
2022-03-08 23:51:46 -08:00
2022-01-31 09:09:37 -08:00
:::note
Some things won't display properly like logos or protobufs, this is not cause for concern.
:::
2022-03-08 23:51:46 -08:00
2022-01-31 09:09:37 -08:00
## Prerequisites
2022-03-08 23:51:46 -08:00
2022-01-31 09:09:37 -08:00
In order to set up your local environment, you will need to install:
- [Node & Node package manager (NPM)](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
- [Yarn package manager](https://yarnpkg.com/getting-started/install)
2022-02-08 05:33:51 -08:00
## Getting Started
2022-03-08 23:51:46 -08:00
2022-01-31 09:09:37 -08:00
### Fork the Meshtastic Repository
Log into Github and create a fork of the [meshtastic/Meshtastic](https://github.com/meshtastic/Meshtastic) repository.
### Clone your Meshtastic Repository fork
:::note
Replace `username` with your Github username.
:::
```bash title="Clone username/Meshtastic Repo"
git clone https://github.com/username/Meshtastic.git
```
### Change directory to Local copy
2022-03-08 23:51:46 -08:00
2022-01-31 09:09:37 -08:00
```bash title="Change Directory"
cd ~/Meshtastic
```
### Install Dependencies
2022-03-08 23:51:46 -08:00
2022-01-31 09:09:37 -08:00
```bash title="Install dependencies using Yarn"
yarn install
```
### Run Development Server
2022-03-08 23:51:46 -08:00
2022-01-31 09:09:37 -08:00
```bash title="Run node.js server"
yarn start
```
2022-02-08 05:33:51 -08:00
:::tip
Before submitting a pull request, it's helpful to run the following command to ensure there are no broken links or errors:
```bash title="Build Project"
yarn build
```
2022-03-08 23:51:46 -08:00
2022-02-08 05:33:51 -08:00
:::
2022-02-22 12:35:03 -08:00
## Update Local Repository
### Verify Upstream Remote is Set
```bash title="Check Remote and Upstream Repositories"
git remote -v
```
If it's set, skip to [Align with meshtastic/Meshtastic Master branch](#align-with-meshtasticmeshtastic-master-branch)
#### Update/Set Upstream if it isn't configured properly
If upstream exists, set the url:
```bash title="Update Upstream Repository"
git remote set-url upstream https://github.com/meshtastic/Meshtastic.git
```
If upstream doesn't exist, add the url:
```bash title="Add Upstream Repository"
git remote add upstream https://github.com/meshtastic/Meshtastic.git
```
### Align with meshtastic/Meshtastic Master branch
:::caution
This will delete any unfinished work. Make sure that you've saved and committed any work you wish to push up to your fork.
:::
:::info
The following command assumes the clone of your Meshtastic fork is in the home directory (`~/Meshtastic`). Adjust the path to the correct path on your machine.
:::
```bash title="Rebase local Meshtastic to remote Meshtastic"
cd ~/Meshtastic ; git fetch upstream ; git checkout master ; git rebase upstream/master
```