Skip to content
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

Use the Jupyter book sphinx theme instead of RTD #227

Merged
merged 10 commits into from
Apr 19, 2021
Merged

Conversation

leouieda
Copy link
Member

@leouieda leouieda commented Apr 14, 2021

The theme is a lot nicer and more modern. It has builtin a lot of the hacks we made to the template to add download and edit buttons. We could also do away with most of our custom templating and CSS tweaks. This opens up the possibility for further style improvements in the future (using admonitions, panels, etc).

Notable changes:

  • the version number is now included in the page title
  • the banner includes the slogan
  • the front page disclaimer is redesigned and not gotten from the README anymore
  • external links are included in index.rst instead of conf.py (this means no icons and different titles but still looks nice)
  • Copyright notice only includes the current year since it applies to the current version

Related to fatiando/maintenance#13

Reminders:

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst and the base __init__.py file for the package.
  • Write detailed docstrings for all functions/classes/methods. It often helps to design better code if you write the docstrings first.
  • If adding new functionality, add an example to the docstring, gallery, and/or tutorials.
  • Add your full name, affiliation, and ORCID (optional) to the AUTHORS.md file (if you haven't already) in case you'd like to be listed as an author on the Zenodo archive of the next release.

The theme is a lot nicer and more modern. It has builtin a lot of the
hacks we made to the template to add download and edit buttons. A few
things to finish:

* Check if the google analytics code is inserted
* Check links to edit sphinx gallery content
@leouieda leouieda marked this pull request as draft April 14, 2021 16:44
@santisoler
Copy link
Member

Nice! It looks way cleaner. Does it have a dark mode? 👀 haha

Check if the google analytics code is inserted

I've served the docs locally and checked that the Google analytics script is loaded in the head. Do we really need it? I would remove it unless we have a very strong reason to keep it.

Makes it easier to regenerate without losing the sphinx-gallery build
This is the easiest way to do it. Includes custom styling for the
version number
There can be conflicts between the docs requirements and older Python
versions. Since we don't want to leave sphinx unpinned to avoid hard to
spot regressions in the docs. This way, it's not installed when running
tests, only when building the docs
@leouieda
Copy link
Member Author

Does it have a dark mode?

I'm sure they'd love a PR adding that 😉

Do we really need it? I would remove it unless we have a very strong reason to keep it.

I kept it since that is one of the few indicators we have of how many people find and use the projects. The download numbers are kind of meaningless with CI and citations are sparse. If we ever go for grant funding, this is a number that should include. The compromise is that we don't gather IP data.

Check links to edit sphinx gallery content

The edit button for sphinx-gallery output is broken since the sources aren't really in the repo. This is something that would best added to the original template rather than us baking our own custom solution. So I'm fine with it being broken for now (nobody ever used those links anyway). What do you think?

Other than that, I think this is done. We can start using the new style in the docs now and improving the layout in subsequent PRs. This was surprisingly smooth and not much work at all 🙂

@leouieda leouieda marked this pull request as ready for review April 15, 2021 10:51
Copy link
Member

@santisoler santisoler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept it since that is one of the few indicators we have of how many people find and use the projects. The download numbers are kind of meaningless with CI and citations are sparse. If we ever go for grant funding, this is a number that should include. The compromise is that we don't gather IP data.

Ok, I get it. We can discuss this later, but another step we could do is to try to move away from Google Analytics to a more transparent data gathering tool.

The edit button for sphinx-gallery output is broken since the sources aren't really in the repo. This is something that would best added to the original template rather than us baking our own custom solution. So I'm fine with it being broken for now (nobody ever used those links anyway). What do you think?

I agree. If anyone is willing to solve a problem with one of our examples, I expect they would find the Contributing guidelines and open an issue or PR to solve it.

I think this is ready to go. I just left a minor comment related to the copyright notice.
After that, I think this is ready to be merged.

doc/conf.py Outdated
# Project information
# -----------------------------------------------------------------------------
project = "Harmonica"
copyright = f"{datetime.date.today().year}, The {project} Developers"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we decided to keep the birth year of the project on the copyright notices, right?

doc/conf.py Outdated Show resolved Hide resolved
@leouieda
Copy link
Member Author

We can discuss this later, but another step we could do is to try to move away from Google Analytics to a more transparent data gathering tool.

I've been searching for alternatives but couldn't find anything that was free or didn't require setting up our own server. If you find anything, let me know!

I think this is ready to go. I just left a minor comment related to the copyright notice. After that, I think this is ready to be merged.

Fixed and merging now!

@leouieda leouieda merged commit b2c76ab into master Apr 19, 2021
@leouieda leouieda deleted the jupyter-book branch April 19, 2021 14:48
@santisoler
Copy link
Member

I've been searching for alternatives but couldn't find anything that was free or didn't require setting up our own server. If you find anything, let me know!

Same here. That's why I wonder if by saving a few bucks using Google Analytics we are transforming our users data into the way to pay for the service 🙃
I'm not very aware if by disabling the IP gather we cannot see the IP of the users or if not even Google cannot see them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants