The first step is to sign up / sign into GitHub.
The next step is to fork the repository to your own GitHub account, to do this go to https://github.com/DKISTDC/proposing-docs/fork.
Then, you clone the repository to your local machine. First make sure you have generated an SSH Key and added it to your GitHub account.
To clone the repository run:
$ git clone git@github.com:<your github username here>/proposing-docs.git
setting your github username as required.
Next we want to add the upstream DKISTDC repository to your local clone:
$ git remote add upstream git@github.com:DKISTDC/proposing-docs.git
Then we can update the remotes with:
$ git remote update
This should set you up with a local copy of the files to edit.
If you don't already have conda installed you can follow the instructions here for installing miniforge.
If you already have conda installed you need to create a new environment for the analysis guide and then install the requirements:
$ conda create -n proposing-docs -c conda-forge python unidep
$ conda activate proposing-docs
$ unidep install .
When coming back to work on the analysis guide make sure you run conda activate proposing-docs
to activate the environment.
If you are using pip, please create an isolated virtual environment and then run:
$ pip install 'unidep[all]'
$ unidep install --skip-conda .
The easiest way to preview the guide as you are working on it is to run:
$ jupyter-book build analysis-guide
The end of this command should print a file path for you to open in your web browser.
The guide is written in a markup language called MyST which is an extension to markdown.
Each chapter has it's own file which are built into a variety of possible output formats by jupyter book.
The chapters of the book are defined in the _toc.yml
file, more information about the structure of the guide can be found in the jupyter book documentation.
To start a new chaper, create a new markdown file (.md
) and then add the filename to the _tox.yml
file.
When writing content in the markdown files, please write one sentence per line as this helps when using git.
Once you have edited the guide and want to submit your changes, you will need to make a Pull Request. To do you this you need to:
- Locally commit your files to git.
- Push these commits to your fork on GitHub.
- Open a Pull Request.
The first step is to create a new local branch with git:
$ git switch -c <branch name>
replace <branch name>
with a name for your branch such as "intro-improvements".
Then we will add and commit all the changes:
$ git add .
$ git commit -m "<some commit message>"
replace <some commit message>
with a short descriptive message such as "fixed typos in intro page".
Next we need to push these changes to your fork on GitHub which we setup at the start of the guide:
$ git push origin <branch name> --set-upstream
again, replacing branch name with the name of the branch you used earlier.
The output of this command should give you a shortcut link to open a pull request from this branch, but if not you can navigate to https://github.com/<your github user name here>/proposing-docs/pull/new/<branch name>
replacing your GitHub username and branch name as needed.
Type a descriptive title and a short description and then click "Create Pull Request".
This will then run some automatic tests and notify people to review your contribution.