|
2 | 2 |
|
3 | 3 | ## Setup Instructions
|
4 | 4 |
|
5 |
| -* [Fork](https://github.com/flaskcwg/flaskcwg.github.io/fork) the repo |
6 |
| - |
7 |
| -* Clone your forked repo |
| 5 | +1. **Fork the repository** |
| 6 | + [Fork the repo](https://github.com/flaskcwg/flaskcwg.github.io/fork) |
8 | 7 |
|
| 8 | +2. **Clone your fork** |
9 | 9 | ```bash
|
10 | 10 | git clone https://github.com/{username}/flaskcwg.github.io.git
|
11 | 11 | cd flaskcwg.github.io
|
12 | 12 | ```
|
13 | 13 |
|
14 |
| -* Setup the upstream to original repo |
15 |
| - |
| 14 | +3. **Set up upstream remote** |
16 | 15 | ```bash
|
17 | 16 | git remote add upstream https://github.com/flaskcwg/flaskcwg.github.io.git
|
18 | 17 | ```
|
19 | 18 |
|
20 |
| -* Create a [virtual environment](https://docs.python.org/3/tutorial/venv.html) and activate it |
| 19 | +4. **Create and activate a virtual environment** |
21 | 20 |
|
22 |
| - For Linux/Mac: |
| 21 | + - **Linux/Mac**: |
| 22 | + ```bash |
| 23 | + python -m venv env |
| 24 | + source env/bin/activate |
| 25 | + ``` |
23 | 26 |
|
24 |
| - ```bash |
25 |
| - python -m venv env |
26 |
| - source env/bin/activate |
27 |
| - # The following also works: `. env/bin/activate` |
28 |
| - ``` |
29 |
| - |
30 |
| - For Windows: |
31 |
| - |
32 |
| - ```bash |
33 |
| - py -m venv env |
34 |
| - env\Scripts\activate.bat # if using command prompt |
35 |
| - # if using bash in windows, you can also do `source env/Scripts/activate` |
36 |
| - ``` |
37 |
| - |
38 |
| -* Install dependencies |
| 27 | + - **Windows**: |
| 28 | + ```bash |
| 29 | + py -m venv env |
| 30 | + env\Scripts\activate.bat # Command Prompt |
| 31 | + # Or for Bash: |
| 32 | + source env/Scripts/activate |
| 33 | + ``` |
39 | 34 |
|
| 35 | +5. **Install dependencies** |
40 | 36 | ```bash
|
41 | 37 | python -m pip install -r requirements.txt
|
42 | 38 | ```
|
43 | 39 |
|
44 |
| -* Run `static.py`. This will build html content in `docs/`. |
45 |
| - |
| 40 | +6. **Build the HTML content** |
46 | 41 | ```bash
|
47 | 42 | python static.py
|
48 | 43 | ```
|
49 | 44 |
|
50 |
| -* Run `serve.py` as shown below. Go to the IP address shown in the printout to view the generated site. |
51 |
| - |
| 45 | +7. **Serve the site** |
52 | 46 | ```bash
|
53 | 47 | cd docs
|
54 | 48 | python serve.py
|
55 | 49 | ```
|
| 50 | + Access the site at the displayed IP address. |
56 | 51 |
|
57 |
| -* To see changes made in [`/templates`](/templates) reflect on the generated site, run `python static.py` again in separate terminal (not needed if you ran `python static.py --server` ) and refresh the url. |
| 52 | +8. **View template changes** |
| 53 | + To reflect updates in [`/templates`](/templates), re-run `python static.py` in a separate terminal, then refresh the browser. |
58 | 54 |
|
59 |
| -## How does the site runs in production? |
| 55 | +## Production Workflow |
60 | 56 |
|
61 |
| -PRs are made to source branch. The source branch is automatically extrapolated to the main branch where gh-pages is deployed |
| 57 | +Pull requests are merged into the source branch, which is automatically deployed to the `gh-pages` branch. |
62 | 58 |
|
63 | 59 | ## How to add a new page?
|
64 | 60 |
|
65 |
| -In `static.py`, under generate, add another generate function: |
| 61 | +In `static.py`, under `generate`, add another `generate` function: |
66 | 62 |
|
67 | 63 | ```python
|
68 | 64 | def main(args):
|
@@ -208,8 +204,4 @@ And hence [link demo](https://flaskcwg.github.io)
|
208 | 204 |
|
209 | 205 | ### FlaskCWG Manager
|
210 | 206 |
|
211 |
| -With this tool you can create, edit and delete blog/faq posts, only pass `--manage` option to `static.py` and go to the given url. |
212 |
| - |
213 |
| -### Percentage of translation of flask documentation |
214 |
| - |
215 |
| -By default, when running `python static.py`, the translation percentage of the translation repositories is not updated, this is to avoid that every time you deploy locally the calculation process is not performed, to run this calculation just pass the `--with-trans-calc` parameter, i.e. `python static.py --with-trans-calc`. |
| 207 | +With this tool you can create, edit and delete blog/faq posts, just execute `python manage.py`. |
0 commit comments