|
2 | 2 |
|
3 | 3 | !!! info |
4 | 4 |
|
5 | | - This page shows you how to contribute to any documentation page or wiki |
6 | | - based on this template. |
7 | | - |
8 | | -!!! note |
9 | | - |
10 | | - This theme is forked from my theme for [Nexus Docs](https://nexus-mods.github.io/NexusMods.MkDocsMaterial.Themes.Next); |
11 | | - and this page is synced with that. |
| 5 | + This page shows you how to contribute to any documentation page or wiki. |
12 | 6 |
|
13 | 7 | ## Tutorial |
14 | 8 |
|
15 | | -!!! note |
16 | | - |
17 | | - If you are editing the repository with the theme itself on Windows, it might be a good idea to run |
18 | | - `git config core.symlinks true` first to allow git to create symlinks on clone. |
19 | | - |
20 | 9 | You should learn the basics of `git`, an easy way is to give [GitHub Desktop (Tutorial)](https://www.youtube.com/watch?v=77W2JSL7-r8) a go. |
21 | 10 | It's only 15 minutes 😀. |
22 | 11 |
|
@@ -51,62 +40,67 @@ It's only 15 minutes 😀. |
51 | 40 |
|
52 | 41 | ## Website Live Preview |
53 | 42 |
|
54 | | -If you are working on the wiki locally, you can generate a live preview the full website. |
55 | | -Here's a quick guide of how you could do it from your `command prompt` (cmd). |
| 43 | +If you are working on the wiki locally, you can generate a live preview of the full website. |
56 | 44 |
|
57 | | -1. Install Python 3 |
| 45 | +### Quick Start (Recommended) |
58 | 46 |
|
59 | | - If you have `winget` installed, or Windows 11, you can do this from the command prompt. |
| 47 | +**Prerequisites:** Python 3.7+ required. |
60 | 48 |
|
61 | | - === "Windows (winget)" |
| 49 | +- Linux: Typically pre-installed |
| 50 | +- macOS: Download from [python.org](https://python.org/) |
| 51 | +- Windows: Run `winget install Python.Python.3` in command prompt |
| 52 | + - Or download manually from [python.org/downloads](https://python.org/downloads/) |
62 | 53 |
|
63 | | - ```bash |
64 | | - winget install Python.Python.3 |
65 | | - ``` |
| 54 | +Run the automated setup script from the project root: |
66 | 55 |
|
67 | | - === "Archlinux" |
| 56 | +```bash |
| 57 | +python3 start_docs.py |
| 58 | +``` |
68 | 59 |
|
69 | | - ``` |
70 | | - pacman -S python-pip # you should already have Python |
71 | | - ``` |
| 60 | +This script will: |
72 | 61 |
|
73 | | - Otherwise download Python 3 from the official website or package manager. |
| 62 | +- Create a virtual environment if needed |
| 63 | +- Install all required dependencies |
| 64 | +- Start the MkDocs live server at http://127.0.0.1:8000 (paste into browser) |
74 | 65 |
|
75 | | -2. Install Material for MkDocs and Plugins (Python package) |
| 66 | +### Manual Setup |
76 | 67 |
|
| 68 | +If you prefer to set up manually without scripts: |
77 | 69 |
|
78 | | - === "Windows/OSX" |
79 | | - |
80 | | - ```bash |
81 | | - # Restart your command prompt before running this command. |
82 | | - # And open command prompt where mkdocs.yml is. |
83 | | - pip install -r ./docs/requirements.txt |
84 | | - ``` |
85 | | - |
86 | | - === "Linux" |
| 70 | +1. **Install Dependencies** |
| 71 | + |
| 72 | + ```bash |
| 73 | + # Navigate to the docs directory |
| 74 | + cd doc/docs/Reloaded |
| 75 | + |
| 76 | + # Create virtual environment (only needs to be done once) |
| 77 | + python3 -m venv venv |
| 78 | + |
| 79 | + # Activate virtual environment (do this each time you work) |
| 80 | + source venv/bin/activate # On Windows: venv\Scripts\activate |
| 81 | + |
| 82 | + # Install requirements |
| 83 | + pip install -r docs/requirements.txt |
| 84 | + ``` |
87 | 85 |
|
88 | | - On Linux, there is a chance that `python` might be a core part of your OS, meaning |
89 | | - that you ideally shouldn't touch the system installation. |
| 86 | +2. **Start Live Server** |
| 87 | + |
| 88 | + ```bash |
| 89 | + mkdocs serve --livereload |
| 90 | + ``` |
90 | 91 |
|
91 | | - Use virtual environments instead. |
| 92 | +  |
92 | 93 |
|
93 | | - ```bash |
94 | | - python -m venv mkdocs # Create the environment |
95 | | - source ~/mkdocs/bin/activate # Enter the environment |
| 94 | + Copy the address to your web browser and enjoy the live preview; any changes you save will be shown instantly. |
96 | 95 |
|
97 | | - # Install contents of requirements file in docs. |
98 | | - pip install -r ./docs/requirements.txt |
99 | | - ``` |
| 96 | +## Troubleshooting |
100 | 97 |
|
101 | | - Make sure you enter the environment before any time you run mkdocs. |
| 98 | +### Windows Symlink Issues |
102 | 99 |
|
103 | | -3. Open a command prompt in the folder containing `mkdocs.yml`. and run the site locally. |
104 | | - ```bash |
105 | | - # Move to project folder. |
106 | | - cd <Replace this with full path to folder containing `mkdocs.yml`> |
107 | | - mkdocs serve |
108 | | - ``` |
| 100 | +If you are editing the **Reloaded.MkDocsMaterial.Themes.R2** (this wiki's theme) repository on Windows, it might be a good idea to run: |
109 | 101 |
|
110 | | -  |
| 102 | +```bash |
| 103 | +git config core.symlinks true |
| 104 | +``` |
111 | 105 |
|
112 | | - Copy the address to your web browser and enjoy the live preview; any changes you save will be shown instantly. |
| 106 | +This allows git to create symlinks on clone. |
0 commit comments