|
1 | | -# User Guide |
| 1 | +# 🧭 User Guide |
2 | 2 |
|
3 | | -The user guide is made with [MkDocs Material](https://squidfunk.github.io/mkdocs-material/). |
| 3 | +This user guide is built using [MkDocs Material](https://squidfunk.github.io/mkdocs-material/), a modern static site generator designed for project |
| 4 | +documentation. |
4 | 5 |
|
5 | | -## Prerequisites |
| 6 | +## ⚙️ Prerequisites |
6 | 7 |
|
7 | | -The only prerequisite is to have [Docker](https://www.docker.com/) installed on your system. |
| 8 | +Before getting started, make sure the following tools are installed and properly configured: |
8 | 9 |
|
9 | | -## Localdev |
| 10 | +* 🐳 [Docker](https://www.docker.com/)<br/> |
| 11 | + Used to run the local development environment and build the documentation without installing Python or MkDocs directly on your machine. |
| 12 | +* 🧑💻 [GitHub CLI](https://cli.github.com/)<br/> |
| 13 | + Required to authenticate with your GitHub account and generate a personal access token when needed. This is necessary because the `git-committers` MkDocs |
| 14 | + plugin may hit the GitHub API's unauthenticated rate limit or require access to private repositories.<br/> |
| 15 | + To authenticate, run: |
| 16 | + ```bash |
| 17 | + gh auth login |
| 18 | + ``` |
| 19 | + Once authenticated, the GitHub CLI will provide the required token via `gh auth token`, which is used by the local development script when starting the |
| 20 | + container. |
10 | 21 |
|
11 | | -Run this command: |
| 22 | +## 🚀 Local Development |
| 23 | + |
| 24 | +To start the local development server, run: |
12 | 25 |
|
13 | 26 | ```bash |
14 | 27 | ./localdev.sh |
15 | 28 | ``` |
16 | 29 |
|
17 | | -### ⚠️ Caveat |
| 30 | +### ⚠️ Important Note |
| 31 | + |
| 32 | +The logs might suggest accessing the preview at `http://0.0.0.0:8000/docker-papermc-server/`, but this will not work. |
18 | 33 |
|
19 | | -Don't try to access the preview at `http://0.0.0.0:8000/docker-papermc-server/` as opposed to what may indicate logs. |
20 | | -Doing so will result in a failure. |
| 34 | +Instead, open the site using one of the following URLs: |
21 | 35 |
|
22 | | -Instead, use `http://localhost:8000/docker-papermc-server/` or `http://127.0.1:8000/docker-papermc-server/`. |
| 36 | +* `http://localhost:8000/docker-papermc-server/` |
| 37 | +* `http://127.0.0.1:8000/docker-papermc-server/` |
23 | 38 |
|
24 | | -## Wrapper Script |
| 39 | +## 🛠 Wrapper Script |
25 | 40 |
|
26 | | -To run `mkdocs` commands, use the `mkdocs.sh` script. For example: |
| 41 | +To run `mkdocs` commands manually, use the `mkdocs.sh` wrapper script. For example: |
27 | 42 |
|
28 | 43 | ```bash |
29 | 44 | ./mkdocs.sh build |
30 | 45 | ``` |
31 | 46 |
|
32 | | -But it is recommended to use the `localdev.sh` script instead unless you know what you are doing. |
| 47 | +That said, unless you have a specific reason, it’s recommended to use `localdev.sh`, as it handles everything needed for local development. |
| 48 | + |
| 49 | +## ➕ Adding Dependencies |
| 50 | + |
| 51 | +When introducing new dependencies, make sure to update both the **local development environment** and the **CI build environment**, as they are managed |
| 52 | +separately. |
| 53 | + |
| 54 | +### 💻 Locally |
| 55 | + |
| 56 | +To update the local environment, open the `Dockerfile` and modify the `RUN pip install ...` line to include any additional packages you need. |
| 57 | + |
| 58 | +### 🤖 In CI |
| 59 | + |
| 60 | +Dependencies for the CI environment are declared in `requirements.in`. After editing this file to include the new packages, run the `requirements.sh` script. |
| 61 | +This will regenerate `requirements.txt`, which is the file actually used by the CI to install dependencies in a consistent and reproducible way. |
0 commit comments