You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The portal site is built with [Sphinx](https://www.sphinx-doc.org/).
12
12
13
-
When testing new content is important to build and view the site. Read the Docs automatically builds the site for you when each Pull Request is checked. You can also build it locally on your machine.
13
+
When testing new content it is important to build and view the site. Read the Docs automatically builds the site for you when each Pull Request is checked. However, you can also build it locally on your machine following the instructions
14
+
below.
14
15
15
16
### Building the site
16
17
17
-
- After checking out a local copy of the site, in your favorite terminal, navigate to the `content` directory of the source repository
18
-
```bash
19
-
cd projectpythia.github.io/content
20
-
```
21
-
- Use [conda](https://docs.conda.io/) to set up a build environment:
22
-
```bash
23
-
conda env create -f ../ci/environment.yml
24
-
conda activate pythia
25
-
```
26
-
- Build the site locally using Sphinx (which you just installed in the `pythia` environment, along with all necessary dependencies):
27
-
```bash
28
-
make html
29
-
```
30
-
- The newly rendered site is now available in `content/_build/html/index.html`.
31
-
Open with your web browser, or from the terminal:
32
-
```bash
33
-
open _build/html/index.html
34
-
```
35
-
- However, many of the links will not work. For all of the links
36
-
found in the portal to work properly, you'll need to set up a local
37
-
testing server. This can be done with Python's http.server by running
38
-
the following command from within the content directory:
18
+
After checking out a local copy of the site, in your favorite terminal, navigate to the `content` directory of the source repository
39
19
20
+
```bash
21
+
cd projectpythia.github.io/content
40
22
```
23
+
24
+
Use [conda](https://docs.conda.io/) to set up a build environment:
25
+
26
+
```bash
27
+
conda env create -f ../ci/environment.yml
28
+
```
29
+
30
+
This will create or update the dev environment (`pythia`).
31
+
32
+
#### Install `pre-commit` hooks
33
+
34
+
This repository includes `pre-commit` hooks (defined in
35
+
`.pre-commit-config.yaml`). To activate/install these pre-commit
36
+
hooks, run:
37
+
38
+
```bash
39
+
conda activate pythia
40
+
pre-commit install
41
+
```
42
+
43
+
Setting up the environment is typically a one-time step.
44
+
45
+
_NOTE_: The `pre-commit` package is already installed via the `pythia` conda environment.
46
+
47
+
#### Building the book locally
48
+
49
+
Build the site locally using Sphinx (which you just installed in the `pythia` environment, along with all necessary dependencies):
50
+
51
+
```bash
52
+
make html
53
+
```
54
+
55
+
The newly rendered site is now available in `content/_build/html/index.html`.
56
+
Open with your web browser, or from the terminal:
57
+
58
+
```bash
59
+
open _build/html/index.html
60
+
```
61
+
62
+
However, many of the links will not work. For all of the links
63
+
found in the portal to work properly, you'll need to set up a local
64
+
testing server. This can be done with Python's http.server by running
65
+
the following command from within the content directory:
66
+
67
+
```bash
41
68
python -m http.server --directory _build/html/
42
69
```
43
70
44
-
- and then pointing your browser at the URL: localhost:8000.
71
+
and then pointing your browser at the URL: localhost:8000.
72
+
73
+
More information on setting up a local test server is available from [here](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/set_up_a_local_testing_server)
45
74
46
-
- More information on setting up a local test server is available from [here](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/set_up_a_local_testing_server)
75
+
When you're done, you can deactivate the dedicated build environment with
76
+
77
+
```bash
78
+
conda deactivate
79
+
```
47
80
48
-
- When you're done, you can deactivate the dedicated build environment with
49
-
```bash
50
-
conda deactivate
51
-
```
52
-
- You can re-activate the `pythia` conda environment at any time with `conda activate pythia`.
81
+
You can re-activate the `pythia` conda environment at any time with `conda activate pythia`.
0 commit comments