Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init Sphinx Docs #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Init Sphinx Docs #1

wants to merge 2 commits into from

Conversation

joey-kilgore
Copy link

@joey-kilgore joey-kilgore commented Dec 6, 2024

Overview

This is an initial sphinx documentation that generates HTML webpages automatically upon any commit/pull request with main. The base of the docs was generated using sphinx-quickstart to create the general files. Additionally I used sphinx-apidoc -o ./source ../superneuromat which helped generate the superneuromat.rst file. Using this you can run the following commands (which are in the docs.yaml workflow) to generate the docs.

pip install .
cd docs
make html

These are very preliminary, but it generates the main files in docs/build/html that can be connected to github pages for deployment.

To see this deployed checkout my fork - https://joey-kilgore.github.io/superneuromat/

Specifics on changes

.gitignore - ignores the extra files from the docs, as well as standard python generated files that should be ignored (including a virtual environment)
docs - all of this is the generated files from sphinx
superneuromat/__init__.py - this file needs to exist for sphinx to find the module
setup.py - add the additional dependencies needed for building docs/development (pytest and sphinx)

Notes for project admin

To deploy this documentation the following steps need to be taken:

  1. go to the project settings
  2. go to the pages tab
  3. select deploy from branch and choose branch gh-pages and the /root directory

Once this is merged and the action runs, it will take a few minutes but then will automatically deploy.

This is setup with the initial sphinx docs, generated using `sphinx-quickstart`
To build docs, run the following
`pip install sphinx`
`cd docs`
`make html`

and that will run the build process for the docs, which should create html pages within `docs/build/html`. This can be set down the line to be run in a github action and pushed to a separate branch for official deployement.
This workflow is a standard github action set to run on any commits/pull requests to `main`
Additionally, the required packages for development needed to be included in the `setup.py`. This should eventually be moved to a more modern `pyproject.toml` file which allows for specifically differentiating the pip install between basic, dev, docs, etc. but for now this should be fine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant