Repository navigation
Deploy API docs from Sphinx autodoc HTML using GitHub pages - #2172
Conversation
Including this will massively inflate the size of any deployment repository (especially if we track the biopython source code master branch), and is of little value over a (tagged version specific) link to GitHub.
Created a pass-phrase less SSH key, uploaded the public key to biopython/docs settings as a deployment key (write permissions). For TravisCI must escape the spaces and newlines as '\ ' and '\\n' respectively when setting DOC_KEY as a secure environment variable. Can test this locally by setting the DOC_KEY environment variable. Idea here is to call this from TravisCI/Tox after running Sphinx to build our API documentation.
|
Note: Looking at the recent history on https://github.com/biopython/docs/commits/gh-pages from testing, even with no code changes there are documentation changes, apparently due to cases of objects as default arguments, e.g. We can probably address this with an explicit |
Workaround for Sphinx argument signature documentation
Codecov Report
@@ Coverage Diff @@
## master #2172 +/- ##
==========================================
- Coverage 84.57% 84.56% -0.01%
==========================================
Files 317 317
Lines 51243 51243
==========================================
- Hits 43338 43336 -2
- Misses 7905 7907 +2
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #2172 +/- ##
==========================================
+ Coverage 84.57% 84.57% +<.01%
==========================================
Files 317 317
Lines 51243 51253 +10
==========================================
+ Hits 43338 43347 +9
- Misses 7905 7906 +1
Continue to review full report at Codecov.
|
|
The documentation changes on e.g. Search https://biopython.org/docs/dev/api/Bio.Restriction.Restriction.html for P.S. We are using |
This module would take a disproportionate amount of time, and since it defines hundreds of classes, takes a lot of space too. Finally, the class order seemed to be non-deterministic.
.../numpydoc/docscrape.py:424: UserWarning: Unknown section Examples: in the docstring
Default blue looked wrong with our logo, this grey is to match that used on biopython.org currently (a Hyde theme)
|
Updated to use the Read-The-Docs theme with our logo and the same dark grey side bar as on https://biopython.org - this to me looks pretty good now: https://biopython.org/docs/dev/api/ |
|
Merging ready to try to do the Biopython 1.74 release later today. |
MarkusPiotrowski
left a comment
There was a problem hiding this comment.
@peterjc I'm missing the correct words to tell you that I think what you tried is great but the result, at the moment, is not optimal.
I would suggest, for the moment, to make both versions of the API available, the 'old' Epydoc as standard and the new Sphinx as an alternative.
While the Sphinx version looks quite stylish, the Epydoc version is much easier to read and understand. One reason for this is related to style (size of main frame, font-size), the other to the organization of the document, e.g. the summary tables for functions and variables, which are available in Epydoc. Also, I'm missing (or haven't found yet) the possibility to directly open the source code, which, for me, is a very useful function.
So, at the moment, when I want to look up some module/function, I would use the Eypdoc version.
Further comments:
-
Possibly a "read the docs" format is not the best format to represent an API. We should, in the future, at least work on the CSS, to make this more readable (larger display, smaller font)
-
The "Home" button on top of the menue frame does link to the API home, not to Biopython.org
-
Another problem, also present in Epydoc, is that variables in function definitions are "filled" with the content, instead of just displaying the name. Epydoc does a little bit better job by abbreviating long list. E.g. compare:
- https://biopython.org/DIST/docs/api/Bio.SeqUtils.MeltingTemp-module.html#Tm_NN
- https://biopython.org/docs/dev/api/Bio.SeqUtils.MeltingTemp.html#Bio.SeqUtils.MeltingTemp.Tm_NN
-
Bio.Restriction.Restriction and Bio.Restriction.Restriction_dictionary are empty. I guess this is deliberate due to the long list of enzyme classes.
|
Thanks Markus, As to links, I agree - for Biopython 1.74 we have both, linked to from the main documentation page although that could be prettier: The Biopython 1.74 tutorial ought to have included a link to the new documentation but I only remembered afterwards. My hope is for Biopython 1.75 we can stop using epydoc, and just use Sphinx for the API docs. Regarding the source code, I turned that off explicitly. Reason one, it will ballon the Styling. There are a number of Sphinx themes, this is currently using the read-the-docs theme. That can be tweaked, or replaced. Also the docstring content itself can be polished (e.g. adopt numpydoc style). Home link (top of side bar). That can probably be changed, although I am in two minds if it should go to the Sphinx documentation home (as now), or biopython.org - and we don't really need the little house icon and text, given the logo is shown below it with the same link. Default arguments in signatures. There are some settings in Sphinx, but this has been a long standing issue for several projects. Typically they want something like Yes, |
|
Fixed the redundancy of the home icon and text Biopython plus the logo in 958bb57 |
|
Logged readthedocs/sphinx_rtd_theme#777 for changing the Sphinx RTD theme's logo URL. |
This comment has been minimized.
This comment has been minimized.
|
@fkgl I think you probable need to look at the snakes project documentation - nothing in your comment seems relevant to Biopython, sorry. |
|
@peterjc Thank you. |
This pull request addresses issue #906, replacing epydoc with Sphinx and autodoc.
Since #1803 we already build the API documentation with Sphinx and autodoc on TravisCI via the tox
apitarget.This adds automated deployment of the HTML output (via a bash script using a deployment key) to the new repository https://github.com/biopython/docs using github pages, to appear online under https://biopython.org/docs/dev/api/ etc (with
.../dev/for the master branch development code, or a version like.../1.74/...instead for releases).This URL patterns should leave open the possibility of hosting all the Tutorial here as well, probably easiest to do if if we convert that from LaTeX to RST and stay within Sphinx, see #907.
This requires an SSH deployment key. We add the public key to https://github.com/biopython/docs (multiple keys can be added, see below), and the private key is added to https://travis-ci.org/biopython/biopython/settings (suitably escaped).
The proposed setup uses the TravisCI
deploy:stage https://docs.travis-ci.com/user/job-lifecycle/ (althoughafter_success:works nicely too), currently restricted to themasterbranch only.Testing on a fork is possible, for example from https://github.com/peterjc/biopython/ to https://github.com/biopython/docs as long as you have the private key (have permission to add a new key to the docs repository). Alternatively we could make it try to push to the owner's fork of the docs repository?
e.g. https://travis-ci.org/peterjc/biopython/jobs/557346277 didn't deploy as
deploywas not themasterbranch (nor should the testing of this pull request trigger a deploy), while identical code in https://travis-ci.org/peterjc/biopython/jobs/557346457 on my fork'smasterbranch did run the deploy script.The implementation right now is in a bash script
.github/deploy_docs.shand tiny helper.github/ssh_via_deploy_key.shbut in principle this private key approach could be added to the tooldoctrinstead (see drdoctr/doctr#348 and drdoctr/doctr#349 where I am working on this).I hereby agree to dual licence this and any previous contributions under both
the Biopython License Agreement AND the BSD 3-Clause License.
I have read the
CONTRIBUTING.rstfile, have runflake8locally, andunderstand that AppVeyor and TravisCI will be used to confirm the Biopython unit
tests and style checks pass with these changes.
I have added my name to the alphabetical contributors listings in the files
NEWS.rstandCONTRIB.rstas part of this pull request, am listedalready, or do not wish to be listed. (This acknowledgement is optional.)