-
Notifications
You must be signed in to change notification settings - Fork 648
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
switched sphinx theme with MDAnalysis styling #1126
Conversation
Figured out why autodoc wasn't working... I overwrote |
e4ec6c1
to
d241db5
Compare
In order to review you need to build locally. I used a virtual env. If you do this, make sure to install sphinx into the venv or otherwise it will fail to pick up packages. If all goes well:
|
Some things aren't great yet
Notes on customization:
|
@orbeckst sorry for not looking over this earlier. I should have some time this week to look over the changes. |
Which version of sphinx are you using? I'm getting build errors with 1.5 also on the master branch |
Latest sphinx from pip. If you use a venv install sphinx into the venv.
What's the error?
…--
Oliver Beckstein
email: orbeckst@gmail.com
Am Dec 20, 2016 um 8:05 schrieb Max Linke ***@***.***>:
Which version of sphinx are you using? I'm getting build errors with 1.5 also on the master branch
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Yes I have sphinx installed in the conda environment. Here is the error I'm getting
|
OK with sphinx=1.4.8 I can compile the docs. It doesn't work with 1.5 and later. |
also when scrolling towards the bottom. I have some more errors. On my laptop screen I can't see the fill side bar. Neither can I scroll the sidebar. It is very hard for me to see where an old function stops and a new function starts. Even worse the note and other boxes are much much more prominent then the actual function and arguments. |
I found an awesome-list for sphinx. They have a theme for autodoc generated docs https://sphinx-readable-theme.readthedocs.io/en/latest/. What I like in that theme is that the line with the function name is highlighted from the background which makes it easy to see when I have a new function. |
The theme has nice features. Can it be customized, namely colors, typeface and logo?
…--
Oliver Beckstein
email: orbeckst@gmail.com
Am Dec 20, 2016 um 15:17 schrieb Max Linke ***@***.***>:
I found an awesome-list for sphinx. They have a theme for autodoc generated docs https://sphinx-readable-theme.readthedocs.io/en/latest/. What I like in that theme is that the line with the function name is highlighted from the background which makes it easy to see when I have a new function.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I think the sidebar can be made non-floating and just part of the page. I agree with your assessment that the autodocs are not very readable.
But this said, if we find a better theme I'm all for it. I just want it to look distinct and matching to some degree our web page. This really amounts to just a few CSS changes but if this can be done with theme variables in the conf.py then that makes life a lot easier.
…--
Oliver Beckstein
email: orbeckst@gmail.com
Am Dec 20, 2016 um 15:06 schrieb Max Linke ***@***.***>:
the author footer can overlap with the sidebar on pages with little content
also when scrolling towards the bottom.
I have some more errors. On my laptop screen I can't see the fill side bar. Neither can I scroll the sidebar.
|
@orbeckst is this still WIP? Or do you want review followed by merge? |
This is still WIP. The sidebar is an issue and the theme makes the config harder to read IMHO. I didn't have time to try out any of the other themes I linked to above. |
This is currently just a test bed and not to be merged. |
a9e49f5
to
765faba
Compare
I played around with the alabaster scheme and I am actually pretty happy with the result; at least I like it better than the old theme. You can see it at http://www.mdanalysis.org/docs/ With a little bit of hacking in The Anyway, comments, please. |
I also tried a customized version of sphinx-readable-theme as suggested by @kain88-de and it looks rather nice. You can compare the two styles:
alabaster has better configuration options via the conf.py file, it can do fancy things with the navigation in the sidebar (unfold the current section that one is in), and it has nice little additions such as travis build status and GitHub links. readable has really nice autodoc sections and overall slightly cleaner layout. @MDAnalysis/coredevs , which theme would you like? I'll then rewrite the PR into a few clean commits, ask for approval by review, and we'll have pretty docs. |
On 05/18/2017 10:51 AM, Oliver Beckstein wrote:
I also tried a customized version of sphinx-readable-theme
<https://sphinx-readable-theme.readthedocs.io/> as suggested by
@kain88-de <https://github.com/kain88-de> and it looks rather nice.
You can compare the two styles:
* *readable*: https://orbeckst.github.io/mdanalysis_docs/
* *alabaster*: http://mdanalysis.org/docs
*alabaster* <http://alabaster.readthedocs.io/en/latest/> has better
configuration options via the conf.py file, it can do fancy things
with the navigation in the sidebar (unfold the current section that
one is in), and it has nice little additions such as travis build
status and GitHub links.
*readable* <https://sphinx-readable-theme.readthedocs.io/> has really
nice autodoc sections and overall slightly cleaner layout.
@MDAnalysis/coredevs
<https://github.com/orgs/MDAnalysis/teams/coredevs> , which theme
would you like? I'll then rewrite the PR into a few clean commits, ask
for approval by review, and we'll have pretty docs.
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
<#1126 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABUWuoDAsiBrEW5FmsgKunCZvAFxqawqks5r7AZ5gaJpZM4LNj8P>.
I like "readable" better. The side bar looks a bit shy, though. Maybe it
would deserve a slightly bigger logo, or a larger font, or a solid gray
background.
|
I also prefer the readable version. |
Graphically I prefer 'readable' (but I don't agree with @jbarnoud's call for a more emphasized sidebar). Is there a way to have the best of both worlds? |
Is there a way to have the best of both worlds?
Probably yes, e.g., by overriding all of alabaster's CSS with readable.css. I can try it but to be honest, right now I don't have much more time to play around with this a lot more. I'll do another round of alabaster and if we then have at least one solution that is better than what we had before then either we take it or someone else starts fiddling. We can always improve things as we go along --- layout and docs will never be perfect.
|
Small question - why don't we use readthedocs to host our docs? That seems to be default choice to host docs by most of the python packages out there. I'm thinking that readthedocs would have already figured out all the design and readability issues, why reinvent the wheel? Devs are already used to it. Also its free and supports webhooks, so that can update docs on each commit. I think, right now @orbeckst does this manually every now and then - this might reduce some work too. |
Fair question, mainly because a long time ago I got super-annoyed trying to get it to build on RTD (they did not support conda then). No-one else took it up since (I think) and so we are back to using GH pages. This works pretty well for the development docs already so we might as well do it.
In any case, the styling is a different question from hosting.
Personally, I am very much bored of the standard RTD style (even though it is quite functional). I am of the opinion that a reasonably sized project such as MDAnalysis also needs to have its own brand identity and so the goal is to have functional docs that are clearly "MDAnalysis". This means that our website and the docs should be using the same typefaces and base colours as well as the logo and overall have a recognizable look and feel. Furthermore, the docs should also be mobile friendly.
Obviously, one can spend and infinite amount of time on CSS pixel pushing and doc refinement but if we can get something for the docs that's 80% ok I am happy.
… On 18 May, 2017, at 11:06, Utkarsh Bansal ***@***.***> wrote:
Small question - why don't we use readthedocs to host our docs? That seems to be default choice to host docs by most of the python packages out there.
--
Oliver Beckstein * orbeckst@gmx.net
skype: orbeckst * orbeckst@gmail.com
|
e911463
to
4440d39
Compare
That's not a problem, we update our docs from travis builds. Developer doc publication is fully automated and integrated in the CI and we will be doing this for the release docs as well (see #1315 ). Just for the playing around with themes I am pushing manually. RTD has one advantage and that is they make it easy to switch between different versions. Ultimately, I don't mind if someone else figures out to make it all work on RTD but time is a pretty precious resource... |
I combined the readable styling with alabaster and you can see the latest version at http://mdanalysis.org/docs. I am happy with it. Either this or pure readable https://orbeckst.github.io/mdanalysis_docs/ |
Once I know what we want to do I will clean up the history in a few sensible commits. Please don't just squash. |
Last iteration looks great and also works well on a tablet. |
44eb443
to
1cfe2bf
Compare
- https://alabaster.readthedocs.io/en/latest/ for notes on styling; note that CSS has to be entered as strings, not as Python lists. - use normal non-floating sidebar in alabaster Using the standard sidebar avoids funny rendering artifacts when the pages are short - collapsible sidebar navigation - only show the TOC in sidebar - enable depth 4 in sidebar, but 2nd level is collapsed until one navigates to the page; we want 4 levels because this is where most of our analysis docs has the per-page headings - use MDA gray for the background in the mobile menu (or when page is very narrow) - enabled Related Topics in sidebar and adjusted font sizes - custom.css: smaller Notes/See Also (admonition) title
Not needed.
- new deploy_master_docs.sh script for pushing to https://github.com/MDAnalysis/docs - EXPERIMENTAL --- only use manually at the moment. - nuke the html/.git --- only needed for manual testing - commit message with fullgy GitHub-linked commit SHA1 - fixed syntax error in die() in maintainer/deploy_docs.sh
- doc front page update: added key information - use sections (now that the TOC has been removed, we have a bit more space to include stuff that people want to know right away) - Getting Involved: includes link to Code of Conduct - Installation: abbreviated quick install (with link) and correct conda channel (MDAnalysis/MDAnalysis.github.io#54) - Source Code: git clone - added link to Topology formats table - must cite each reference somewhere Newer sphinx versions (1.6.x or so) throw a warning for any reference that is not cited anywhere. - Now we cite every reference in the Reference page itself instead of linking these references to the individual module reference sections. - Touched up encore docs references. - small reST fix in coordinates/__init__ and analysis.pca
We use a stripped-down version of the readable.css_t from https://github.com/ignacysokolowski/sphinx-readable-theme as a custom CSS (included in custom.css). Minor touch-ups are performed in custom.css. The overall effect is Alabaster fancyness with readable style.
1cfe2bf
to
5da4146
Compare
I rewrote the history of this PR into sensible units. Please merge as is (do not squash). Compared to the last revision I also increased the level depth of headings in the navigation sidebar to 4; it's sometimes a bit more cluttered but I think it's important that even deep in analysis docs you can still navigate around, eg http://www.mdanalysis.org/docs/documentation_pages/analysis/hbond_analysis.html @MDAnalysis/coredevs please have a look at http://www.mdanalysis.org/docs and if you are in general happy with this then I would like to merge this. (We can do more CSS adjustments and fine-tuning as we go along.) The |
PS: I am not 100% sure why the build status badge on the docs shows "error". It refers to the master branch (this is hard-coded in the alabaster theme as far as I can tell) https://api.travis-ci.org/MDAnalysis/mdanalysis.svg?branch=master I am not sure why it should show an error because looking at https://travis-ci.org/MDAnalysis/mdanalysis/branches our master branch is shown as green (although https://travis-ci.org/MDAnalysis/mdanalysis/builds/232796240 errored...) – any insights welcome. |
Has any one of the current reviewers @kain88-de @dotsdl @tylerjereddy any further comments? This needs at least one approval so that it can get merged. @kain88-de : Please merge (and don't squash) because the commits are independent. Thanks. |
Fixes #378
Changes made in this Pull Request:
See screenshot for what it looks like:
PR Checklist
Problems
I can't build the docs locally at the moment: sphinx.autodoc appears to fail.