-
Notifications
You must be signed in to change notification settings - Fork 6
Proposal for versioned documentation #13
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
base: master
Are you sure you want to change the base?
Changes from all commits
54e1c9b
4e61912
cc376a2
22c20c1
5be4e04
8ab89f9
9b450f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Versioned Documentation | ||
|
||
We are starting to run into issues with people trying to use Fairlearn installed from PyPI with the documentation on [our website](https://fairlearn.github.io/). | ||
This is an issue because we have made and are making a number of breaking changes to our API. | ||
The solution to this is to provide versioned documentation, so that users can read the docs associated with the version they have installed. | ||
This is the pattern used by projects such as [SciKit-Learn](https://scikit-learn.org). | ||
|
||
The basic pattern is to change the layout of the `fairlearn.github.io` repository so that there is a directory for each version of the documentation. | ||
There is then a root level `index.html` to redirect users to an appropriate default directory (either latest release, or the development branch). | ||
See the [SciKit-Learn documentation repo](https://github.com/scikit-learn/scikit-learn.github.io) for an example. | ||
|
||
There are tools to help with this, such as: | ||
- [sphinx-multiversion](https://pypi.org/project/sphinx-multiversion/) | ||
- [sphinxcontrib-versioning](https://pypi.org/project/sphinxcontrib-versioning/) | ||
|
||
The latter of these last had a PyPI release in 2016. The last repo commit was in 2019, but there was little activity after 2016. | ||
As such, it is probably not a wise choice. | ||
|
||
The `sphinx-multiversion` tool has more recent updates, and the author has been very helpful with debugging issues the Fairlearn documentation. | ||
Some of these have resulted from Windows, and the author has issued patches for them. | ||
Unfortunately, there is a more fundamental issue: we have substantially changed the `examples/` directory, and this means that the latest `conf.py` does not work with `v0.4.6`. | ||
This is not compatible with the way `sphinx-multiversion` works. | ||
|
||
## Tool Selection | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any idea about the tools you want to use for this? @cedarfall looked into some of them recently and found: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do some more reading. When I was writing this, I was primarily thinking about the v0.4.6 issue (not to mention the even older versions for which all the sphinx docs will vanish). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need to care. Scikit learn starts somewhere around 0.17 or so and that's fine. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't mean to go back to the beginning, but I would like to be able to generate docs for v0.4.6. I've been reading the docs for both sphinxcontrib-versioning and sphinx-multiversion. Both look like they can go back to older versions just fine. Comparing: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Been trying to persuade |
||
We should onboard to using `sphinx-multiversion` going forwards. | ||
However, if we want `v0.4.6` documentation, that will have to be a special case. | ||
It should be relative straightforward to add it to the `fairlearn.github.io` repository manually, once `sphinx-multiversion` has taken over main documentation build. | ||
We will then at least have a URL we can share with those who encounter issues. | ||
|
||
Since `sphinx-multiversion` builds every version of the documentation each time and we have some examples which take a while to generate, it is possible that we might start to bump against the time limits of our free CircleCI account. | ||
If this happens, we will have to devise workarounds. | ||
|
||
## Required Changes | ||
|
||
Moving to versioned documentation will require a number of changes to the workings of our `docs/` directory. | ||
|
||
Our static, professionally designed landing page should be removed from the Sphinx build. | ||
The assets should be saved in a separate directory, and copied to the appropriate location by a script after the main documentation has been built. | ||
|
||
To access the different versions of the documentation, `sphinx-multiversion` [provides two samples](https://holzhaus.github.io/sphinx-multiversion/master/templates.html) of HTML fragments which can be generated with appropriate links. | ||
Unfortunately, it appears that currently the `pydata-sphinx-theme` we're using does not currently support customised sidebars. | ||
I have [opened an issue on their GitHub repo](https://github.com/pandas-dev/pydata-sphinx-theme/issues/234) about this, and it has been acknowledged. | ||
If no better solution can be found, then I can adjust the generated code from `sphinx-multiversion` to be a full webpage, and have it redirect to the `master` version after a pause of five seconds. | ||
The 'User Guide' links on the static landing page can then point to this version-selection page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please link this somewhere as well fairlearn/fairlearn#482
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mention links it :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once checking in it won't