The website is composed of 3 pages:
- Home
- Specs
- Package
Each page corresponds to a Jupyter notebook, where the text is written in markdown, following these syntax rules: https://jupyterbook.org/en/stable/content/#. The Jupyter notebooks are then converted into HMTL files using Jupyter Book, version 1.
In the future, once Jupyter Book version 2 is available, we will write the documentation in MyST, an enhanced version of markdown. The changes will not concern plain text (i.e., the majority of this documentation), but admonitions and other graphical content. We will also have to merge the files _config.yml and _toc.yml into one single file called myst.yml. If you want to know more about all this, check here: https://github.com/orgs/executablebooks/discussions/1199
- Clone the GitHub repository https://github.com/ormir-mids/ormir-mids.github.io in your preferred way
- Create your branch
In terminal:
- Create a virtual environment called, for example,
ormir-mids-doc-env:
python3 -m venv ormir-mids-doc-venv(command for MacOS) - Activate the virtual environment:
source ormir-mids-docs-venv/bin/activate(command for MacOS)
- Install JupyterLab:
pip3 install JupyterLab - Install MyST for JupyterLab (if you don't use JupyterLab, find installation info here: https://mystmd.org/guide/quickstart):
pip3 install jupyterlab_myst - Install jupyter book:
pip3 install jupyter-book
- In the terminal, Open JupyterLab (from the virtual environment):
jupyter lab - In JupyterLab, navigate to the
.ipynbfiles and modify whatever is needed - If you are not familiar with MyST, find a quick guide here: https://mystmd.org/guide under
Authoring
- If it's the first time you create a Jupyter Book, you can learn more here: https://jupyterbook.org/en/stable/start/create.html#anatomy-of-a-book
- In the terminal, build the book with the command:
jupyter-book build ormir-mids-docs - The HTML version of the book will be in
_built/html/
- In terminal, deactivate the virtual environment
deactivate(command for MacOS) - Send a pull request
- After the first time setup, you can work on the documentation by:
cdto the root folder (e.g.ormir-mids-docs)- Activate the virtual environment (second point in Step 2) and then follow the steps above from 4 to 6
The following is just an explanation on how GitHub Actions is implemented and used to create the website. It does not require any action from the contributors
Learning material:
- How GitHub CI/CD works: this video
- How to deploy a Jupyter Book using GitHub Actions: this webpage
Practically:
- In the GitHub repository, go to
Settingstab ->Pageson the left panel -> UnderBuild and deployment,Source-> SelectGitHub Action - In the GitHub repository, go to the
Codefile -> Press the buttonAdd fileand thenCreate new file-> In the file name prompt, if your filename is calledci.yml, write.github/workflows/ci.yml. In the file copy/paste the content from this page - Make sure that in the repo, there are the following files
.nojekyll,requirements.txt,_config.yml,_toc.yml, the notebooks, and the figures (in a folder) - Every time you push, the book will be automatically created. You can follow under the
Actionstab