-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add Documentation #65
Conversation
This looks like a good start. Embedding the README obviously isn't the right solution long term, but it makes sense as a placeholder until we write a proper manual. Can you describe a bit about the mechanism for building the docs? Does this mean that every time we merge a pull request, it will automatically commit a new build of the docs to the repository, even if the PR didn't change anything related to docs? |
The docs are build using sphinx-build. The commands to do this are provided in a standard sphinx makefile. Steps to build the docs:
The html docs will now be in when a new commit is pushed to main on the repo (or pull request merged) the workflow will build the docs using the above procedure. It then checkouts the gh-pages branch, commits any changes to the html docs, and pushes them back to the gh-pages branch. This all happens in If a release is made then the workflow will make a copy of the docs at |
I suggest hosting this in https://readthedocs.org
|
Open to using read the docs. Not used it before but will have an experiment on a personal test copy! Two points about using readthedocs:
I don't think readthedocs adds any functionality we can't get ourselves using gh-pages but definitely looks cleaner and less error prone than the equivalent gh-actions workflows. |
I have an allergy to ads of all sorts. |
I did try out readthedocs, it definitely works rather easily. Although I think my preference would be hosting the docs ourselves to have more control. We can easily do this using the gh-pages branch on this repo. It can be all automated with gh-actions workflow that we already have from the cookbook (once I clean it up a bit more). We can then always move the docs somewhere else easily (just copy the static pages). And it keeps everything in one place. |
I'm fine with keeping the built docs here. Any further comments, or is this ok to merge? |
|
As far as I understand there is no way to test this PR unmerged. It requires having a branch with the special name gh-pages in openmm-ml. |
I am going to merge it in and will reopen to solve any lingering issues. |
The documentation has been successfully deployed to https://openmm.github.io/openmm-ml/ |
Thanks! I notice that when I click that link it redirects to https://openmm.github.io/openmm-ml/dev/index.html. Is that the right address? |
As far as I understand the workflow has two triggers:
|
Yes exactly that is the intention. It mirrors the openmm docs naming convention. Here is an example of me testing the deployment on a fork with a dummy release: https://sef43.github.io/openmm-ml-docs-test/latest/index.html |
Ok, just making sure. |
This PR is a try at adding documentation which adresses #2 and comments in #60 .
The format is up for discussion.
I have used a more modern sphinx template than the OpenMM docs: https://pydata-sphinx-theme.readthedocs.io/en/stable/
One key reason for using this template is that it has version switching and warnings available.
The Docs are built by running
make html
in thedoc
folder.Currently there is a userguide section which is just the readme and an API section.
I have included a gh-actions workflow (copied from the cookbook) that renders the docs on the gh-pages branch. The latest commit to main is rendered at
/dev
. When a release is cut a corresponding version of the docs is created at/<version>
./latest
points to the most recent release.The rendered version for this fork can be seen here: https://sef43.github.io/openmm-ml/dev/index.html (currently just has dev build)
I have made a rest repo with some dummy releases to show the version switching capabilities: https://sef43.github.io/openmm-ml-docs-test/1.1/