-
Notifications
You must be signed in to change notification settings - Fork 1
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 Github Pages using Sphinx documentation #19
base: main
Are you sure you want to change the base?
Conversation
The GitHub Actions workflow for building documentation has been significantly updated. A new job for configuring GitHub Pages has been added, run on ubuntu-latest. In addition, the original job for building HTML is split into separate jobs for building the pages and deploying the artifact, again run on ubuntu-latest. These additions should streamline and speed up
The GitHub Actions workflow for building documentation has been significantly updated. A new job for configuring GitHub Pages has been added, run on ubuntu-latest. In addition, the original job for building HTML is split into separate jobs for building the pages and deploying the artifact, again run on ubuntu-latest. These additions should streamline and speed up
The changes made refactor the method documentation from 'Params' to 'Args' in trelliscope.py, focusing on clearer syntax. Several documentation files (index.rst, usage.ipynb) have been removed while others (.github/workflows/build-docs.yml, pyproject.toml) have been updated within the project. Overall, these changes ensure coding standards and update documentation system.
The Sphinx command used in the GitHub Actions workflow for building documentation has been simplified. The "-W" and "--keep-going" flags that were previously used have been removed.
The Sphinx command used in the GitHub Actions workflow for building documentation has been simplified. The "-W" and "--keep-going" flags that were previously used have been removed.
The Sphinx command used in the GitHub Actions workflow for building documentation has been simplified. The "-W" and "--keep-going" flags that were previously used have been removed.
Changed the build output directory from '_build/html' to './_site' in the workflow file 'build-docs.yml'. Replaced the
The version of the 'deploy-pages' action used in the 'build-docs' GitHub workflow has been updated from v1 to v4. This will ensure the use of the latest version which might include improved features or bug fixes.
The build-docs GitHub actions workflow has been updated to adjust the pages deployment process. The 'build-pages' job now runs on ubuntu and installs pandoc via wget instead of brew. The deployment has been integrated into the 'build-pages' job for more streamlined operation.
The build-docs GitHub actions workflow has been updated to adjust the pages deployment process. The 'build-pages' job now runs on ubuntu and installs pandoc via wget instead of brew. The deployment has been integrated into the 'build-pages' job for more streamlined operation.
…into feature/docs-notebooks
…ebook with embedded remote trelliscopes.
@Lodewic thanks this looks awesome! I think google style is good. @sburton42 let me know if you have any additional comments otherwise I am good to merge. |
Hi @hafen, thank you! I am happy to hear you like it and feel like it is ready to merge There are some additional changes that need to be made to the pages before they are complete, which is why I flagged this PR as a [Draft]. However, I try to avoid creating a single Huge PR that changes too many things at once. Before merging this, I think it would be nice to have a better first version of the docs in place. To achieve that, I would first like to make a series of PR's that would be merged into this one. These would be PR's such as:
Finally, before merging this, there are some Github repository settings that need to be configured for Github Pages to work. I don't have permissions to configure that but I am happy assist when the time comes. |
This all sounds great to me, including the use of the Google style. Thanks! |
@Lodewic I agree and think it's great to go ahead with each of those bullets. Are these things you would be interested in contributing? I am happy to assist but would need some direction since my development involvement is mostly on the R/JS side. |
@hafen I am definitely aiming to contribute the bulletpoints I stated. Hope to find time this weekend. I saw you made updates to the JS side of things and it makes me wonder if there are other channels where you collaborate that I might join the conversation. |
@Lodewic yes it would be great to add you to our slack channel. Send me a note at rhafen@gmail and I'll get you added. Thanks! |
…, except for tests and __init__ files
Feature/docstrings google style
…into feature/docs-notebooks
@hafen and @sburton42 , all the changes I wanted to implement for a first version of the docs are done! Have a look and let me know what you think: https://lodewic.github.io/trelliscope-py/
Now with:
|
To enable Github Pages for this repositoy, go to Not every branch is set up to update the docs, this is configured under |
Github Pages with Sphinx
This PR adds a Github Action to publish Github Pages, with documentation created with Sphinx and
nbsphinx
to allow writing pages with Jupyter notebooks.The Preview hosted from my fork is here: https://lodewic.github.io/trelliscope-py/
Deploying using Github Actions
Added a new workflow that builds and publishes Sphinx documentation from a new
./docs
directory.Sphinx documentation
I am using Sphinx with the
nbsphinx
plugin. Sphinx is commonly used and can generate a classic 'read-the-docs` style for documentation. I also found bootstrap themes that are more similar to the TrelliscopeJS documentation - but they did not work for me out of the box.For most of the codebase I intend to heavily
autodoc
andautomodule
. This will automatically document all the objects in a module, granted that they have a docstring in the first place. Docstrings are parsed and rendered automatically, but... this requires an agreed-upon style.Docstring style
To make Sphinx documentation work with autodoc, we should choose one of 2 docstring-styles:
Personally I prefer the Google-style docstrings.
When being strict about type-hinting everything, types do not need to be included in the docstrings, which is nice. A good extension to handle type-hints with autodoc is this, https://pypi.org/project/sphinx-autodoc-typehints
About
nbsphinx
Use Jupyter Notebooks to create documentation pages, largely for runnable examples. Documentation here: https://nbsphinx.readthedocs.io/en/0.9.3/
Using Jupyter notebooks to create documentation is quite powerful I think, and makes the example notebook you made instantly available in the documentation pages. I intend to create more example notebooks, both for users and for developers.
Additionally, when generating the documentation, the documentation notebooks are actually executed. Therefore I consider these a type of integration test, creating incentive to create documentation that executes most of the codebase. Also, by executing the notebooks in a workflow - and failing when any notebook fails - we ensure that all examples are in fact reproducible for users.