|
2 | 2 |
|
3 | 3 | [](https://github.com/StrangeBeeCorp/docs/actions/workflows/pages/pages-build-deployment)
|
4 | 4 |
|
5 |
| -The documentation uses mkdocs to render the content. |
| 5 | +The documentation uses MkDocs to render the content. |
6 | 6 |
|
7 | 7 | ## Test changes
|
8 | 8 |
|
| 9 | +### Option 1: Use Python locally |
| 10 | + |
| 11 | +This method uses Python installed directly on your machine to run the MkDocs server. |
| 12 | + |
| 13 | +#### 1. Install Python and pip (if not already installed) |
| 14 | + |
| 15 | +#### 2. Create a virtual environment (recommended) |
| 16 | +A virtual environment keeps dependencies isolated and avoids conflicts. |
| 17 | + |
| 18 | +##### 2.1 Create the virtual environment |
| 19 | + |
| 20 | +Place it in a dedicated directory outside your project directory: |
| 21 | +```bash |
| 22 | +python3 -m venv ~/venvs/mkdocs-env |
| 23 | +``` |
| 24 | + |
| 25 | + ##### 2.2 Activate the virtual environment |
| 26 | + |
| 27 | +* Linux/macOS |
| 28 | +```bash |
| 29 | +source ~/venvs/mkdocs-env/bin/activate |
| 30 | +``` |
| 31 | + |
| 32 | +* Windows (Command Prompt) |
| 33 | +```cmd |
| 34 | +~/venvs/mkdocs-env\Scripts\activate |
| 35 | +``` |
| 36 | + |
| 37 | +* Windows (PowerShell) |
| 38 | +```powershell |
| 39 | +~/venvs/mkdocs-env\Scripts\Activate.ps1 |
| 40 | +``` |
| 41 | + |
| 42 | +##### 2.3 Verify activation |
| 43 | + |
| 44 | +The name of your environment should appear in brackets at the beginning of your command line. |
| 45 | + |
| 46 | +#### 3. Install the requirements |
| 47 | + |
| 48 | +In your project directory, install the required dependencies: |
| 49 | + |
9 | 50 | ```bash
|
10 |
| -# Install the requirements first |
11 |
| -pip install -r requirements.txt |
| 51 | +pip3 install -r requirements.txt |
| 52 | +``` |
| 53 | + |
| 54 | +#### 4. Start the MkDocs server |
12 | 55 |
|
13 |
| -# Start the mkdocs server in development mode |
| 56 | + ##### 4.1 Run the MkDocs development server: |
| 57 | + |
| 58 | +```bash |
14 | 59 | mkdocs serve
|
15 | 60 | ```
|
16 | 61 |
|
17 |
| -Alternatively you can use a docker container: |
| 62 | +##### 4.2 Once the server is running, open your browser and visit http://127.0.0.1:8000. |
18 | 63 |
|
| 64 | +### Option 2: Use a Docker container |
| 65 | + |
| 66 | +This method uses Docker to run the MkDocs server in an isolated container. All dependencies, including Python, are installed inside the container. |
| 67 | + |
| 68 | +##### 1. Build the Docker image |
| 69 | + |
| 70 | +The Docker image bundles Python, MkDocs, and all necessary dependencies: |
19 | 71 | ```bash
|
20 | 72 | docker build . -t docs
|
| 73 | +``` |
| 74 | + |
| 75 | +##### 2. Run the Docker container |
| 76 | + |
| 77 | +Start the container and expose the documentation server locally: |
| 78 | +```bash |
21 | 79 | docker run -it --rm -p 8000:8000 -v $PWD:/docs docs
|
22 | 80 | ```
|
23 | 81 |
|
| 82 | +##### 3. The documentation server will be accessible at: http://127.0.0.1:8000. |
| 83 | + |
24 | 84 | ## Deployment
|
25 | 85 |
|
26 |
| -The `main` branch is automatically deployed to [docs.strangebee.com](https://docs.strangebee.com) |
| 86 | +The `main` branch is automatically deployed to [docs.strangebee.com](https://docs.strangebee.com). |
27 | 87 |
|
28 | 88 | If not:
|
29 | 89 |
|
|
0 commit comments