|
1 |
| -# How to Contribute |
| 1 | +# Pythia Foundations contributor's guide |
2 | 2 |
|
3 | 3 | ```{note}
|
4 | 4 | This content is under construction!
|
5 | 5 | ```
|
6 | 6 |
|
7 |
| -This site is built with [JupyterBook](https://jupyterbook.org). |
| 7 | +General information on how to contribute to any Project Pythia repository |
| 8 | +may be found [here](https://projectpythia.org/pages/contributing.html). |
8 | 9 |
|
9 | 10 | A full contributor's guide will appear here, cross-referencing our tutorials on open Pull Requests on GitHub.
|
10 | 11 |
|
11 |
| -A simple way to comment on anything you find in this book is to use the "open issue" and "suggest edit" buttons under the GitHub Octocat logo at the top of each page. These links will take you to GitHub where the source material for the book is hosted. You'll need a free (and broadly useful) GitHub account. |
| 12 | +A simple way to comment on anything you find in this book is to use the "open issue" and "suggest edit" buttons under the GitHub Octocat logo at the top of each page. These links will take you to GitHub where the source material for the book is hosted. You'll need a free (and broadly useful) GitHub account. See |
| 13 | +the main [Project Pythia Contributor's Guide](https://projectpythia.org/pages/contributing.html). |
| 14 | + |
| 15 | +## Contributing a new Jupyter Notebook |
12 | 16 |
|
13 | 17 | If you'd like to contribute a Jupyter Notebook to these materials, please reference our [template](template) viewable on the next page. This template is available to you in `preamble/template.ipynb` if you've cloned the repository, or available as a download [directly from GitHub](https://github.com/ProjectPythia/pythia-foundations/raw/main/preamble/template.ipynb).
|
14 | 18 |
|
15 | 19 | Basic instructions on how to build the JupyterBook locally can be found on the README page of the book's [source repository on GitHub](https://github.com/ProjectPythia/pythia-foundations).
|
| 20 | + |
| 21 | +## Building the site |
| 22 | + |
| 23 | +### Create a conda environment |
| 24 | + |
| 25 | +The first time you check out this repository, run: |
| 26 | + |
| 27 | +```bash |
| 28 | +$ conda env update -f environment.yml |
| 29 | +``` |
| 30 | + |
| 31 | +This will create or update the dev environment (`pythia-book-dev`). |
| 32 | + |
| 33 | +### Install `pre-commit` hooks |
| 34 | + |
| 35 | +This repository includes `pre-commit` hooks (defined in `.pre-commit-config.yaml`). To activate/install these pre-commit hooks, run: |
| 36 | + |
| 37 | +```bash |
| 38 | +$ conda activate pythia-book-dev |
| 39 | +$ pre-commit install |
| 40 | +``` |
| 41 | + |
| 42 | +This is also a one-time step. |
| 43 | + |
| 44 | +_NOTE_: The `pre-commit` package is already installed via the `pythia-book-dev` conda environment. |
| 45 | + |
| 46 | +### Building the book locally |
| 47 | + |
| 48 | +To build the book locally, run the following: |
| 49 | + |
| 50 | +```bash |
| 51 | +$ conda activate pythia-book-dev |
| 52 | +$ jupyter-book build . |
| 53 | +``` |
| 54 | + |
| 55 | +Finally, you can view the book by opening the file `_build/html/index.html` with your favorite web browser. On most platforms you can simply run: |
| 56 | + |
| 57 | +``` |
| 58 | +open _build/html/index.html |
| 59 | +``` |
| 60 | + |
| 61 | +All code is licensed under Apache 2.0 (including both infrastructure code and example code in the rendered Pythia Foundations book). All other content in Pythia Foundations is licensed under [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/) |
0 commit comments