From 11ba0bdd8e6ce847e699fdf2ef9b54c1d48a38fb Mon Sep 17 00:00:00 2001 From: clyne Date: Tue, 15 Jun 2021 12:35:31 -0600 Subject: [PATCH] Restructuring of contributor's guide to be consistent with portal guide (#71) * Restructuring of contributor's guide to be consistent with changes made in the main Project Pythial Portal contributor's guide * Review comments --- CONTRIBUTING.md | 2 ++ README.md | 40 --------------------------- preamble/how-to-contribute.md | 52 +++++++++++++++++++++++++++++++++-- 3 files changed, 51 insertions(+), 43 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..7578f930b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,2 @@ +Information on how to contribute to this repository can be found +in the [Pythia Foundations Contributor's Guide](https://foundations.projectpythia.org/preamble/how-to-contribute.html). diff --git a/README.md b/README.md index 5878a3ce2..b59fa70f8 100644 --- a/README.md +++ b/README.md @@ -5,43 +5,3 @@ This is the source repository for the Project Pythia Foundations content collect The rendered site can be found at https://foundations.projectpythia.org The book is powered by [Jupyter Book](https://jupyterbook.org/intro.html). - -## For Contributors - -### Create conda environment - -The first time you check out this repository, run: - -```bash -$ conda env update -f environment.yml -``` - -This will create or update the dev environment (`pythia-book-dev`). - -### `pre-commit` hooks - -This repository includes `pre-commit` hooks (defined in `.pre-commit-config.yaml`). To activate/install these pre-commit hooks, run: - -```bash -$ conda activate pythia-book-dev -$ pre-commit install -``` - -_NOTE_: The `pre-commit` package is already installed via the `pythia-book-dev` conda environment. - -### Building the book locally - -To build the book locally, run the following: - -```bash -$ conda activate pythia-book-dev -$ jupyter-book build . -``` - -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: - -``` -open _build/html/index.html -``` - -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/) diff --git a/preamble/how-to-contribute.md b/preamble/how-to-contribute.md index e5d4a7329..850fe7425 100644 --- a/preamble/how-to-contribute.md +++ b/preamble/how-to-contribute.md @@ -1,15 +1,61 @@ -# How to Contribute +# Pythia Foundations contributor's guide ```{note} This content is under construction! ``` -This site is built with [JupyterBook](https://jupyterbook.org). +General information on how to contribute to any Project Pythia repository +may be found [here](https://projectpythia.org/pages/contributing.html). A full contributor's guide will appear here, cross-referencing our tutorials on open Pull Requests on GitHub. -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. +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 +the main [Project Pythia Contributor's Guide](https://projectpythia.org/pages/contributing.html). + +## Contributing a new Jupyter Notebook 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). 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). + +## Building the site + +### Create a conda environment + +The first time you check out this repository, run: + +```bash +$ conda env update -f environment.yml +``` + +This will create or update the dev environment (`pythia-book-dev`). + +### Install `pre-commit` hooks + +This repository includes `pre-commit` hooks (defined in `.pre-commit-config.yaml`). To activate/install these pre-commit hooks, run: + +```bash +$ conda activate pythia-book-dev +$ pre-commit install +``` + +This is also a one-time step. + +_NOTE_: The `pre-commit` package is already installed via the `pythia-book-dev` conda environment. + +### Building the book locally + +To build the book locally, run the following: + +```bash +$ conda activate pythia-book-dev +$ jupyter-book build . +``` + +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: + +``` +open _build/html/index.html +``` + +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/)