Writing documentation and building the site locally#
Contributing to eva Docs#
To contribute to the eva documentation website, create a branch with your changes, and then submit a pull request to the eva-docs repository: JCSDA-internal/eva-docs
Local eva Docs Build#
It may be useful to build the website locally to ensure that any changes are properly displayed on the website before submitting a pull request.
Creating a conda environment is recommended, but not required. The dependencies for nbsite tend to be tricky, and having a pre-existing environment with other package versions may cause the build to not work.
Steps for locally building and viewing website:#
NOTE: git-lfs needs to be installed to be able to clone notebooks from the eva-docs repository. If you make a self-contained environment, you may need to run conda install git, conda install git-lfs, and git lfs install. Then, reclone the eva-docs repository.
Clone eva and eva-docs directories
eva - https://github.com/JCSDA-internal/eva
eva-docs - https://github.com/JCSDA-internal/eva-docs
cd eva-docsSet up dependencies for eva-docs
To do this in a self-contained environment (recommended):
conda env create -f environment.yamlconda activate eva-docs
To add dependencies to current environment:
pip install -r requirements-github.txt
Install eva to run jupyter notebooks:
pip install ../evaGenerate the
.rstfiles for the jupyter notebooks:nbsite generate-rst --org JCSDA-internal --project-name eva-docs --examples notebooksCreate API docs with this command:
sphinx-apidoc -o doc/eva_developer_guide/API/ ../eva/srcAPI documentation setup:
python doc/api_setup.py doc/eva_developer_guide/API/Build site:
nbsite buildcd builtdocsRun
python -m http.server 8000to start local serverType
localhost:8000into a web browser to view the website
API Docs#
To contribute to the eva API documentation, create a branch in eva and write comments directly into the source code, making sure that they adhere to Google-standard docstrings. Then, submit a pull request to eva using this branch. Sphinx-based tools will autogenerate the comments into documentation for the website.