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

[MRG] Change Sphinx theme (and fix minor typos) #971

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

asoplata
Copy link
Collaborator

This makes a big visual change to the "Code Website" at https://jonescompneurolab.github.io/hnn-core/stable/index.html , whereby it changes the theme from the unmaintained sphinx-bootstrap-theme to the actively maintained and popular pydata-sphinx-theme. The first commit also fixes some typos currently present in the documentation Makefile. This is part of the changes organized in #969.

This resolves #941 because search is provided entirely by the theme; this also enables us to remove doc/_templates/search.html.

This resolves #908 because version-hyperlinking is supported by the theme too, enabling us to remove doc/_templates/navbar.html. Instead, in the future, versions will need to be specific in doc/_static/versions.json.

A note about the versioning system: the PyData theme insists that the file your versioning metadata "...needs to be at a stable, persistent, fully-resolved URL" ( https://pydata-sphinx-theme.readthedocs.io/en/latest/user_guide/version-dropdown.html#configure-switcher-json-url ). Thus, currently in this PR, the versions.json URL is set to point to an existing file I manually added to the gh-pages branch for the stable version, accessible here: https://jonescompneurolab.github.io/hnn-core/stable/_static/versions.json ( new code using this resource is located here: b85b222#diff-e170e9a7d787c21095c6c11bb25f0f1ff0294a42a46d45ba6fb5ed794e457624R105 ). AFTER this PR is merged, 3 things will happen:

  1. The master branch will then contain its own local copy of doc/_static/versions.json.
  2. The CircleCI docs build runner will update the dev version of the website, which will then cause this new file to be located at https://jonescompneurolab.github.io/hnn-core/dev/_static/versions.json. This is the "version" of the "version file" that we should use after this point (which is what other theme users do).
  3. We need to then make a second, much smaller PR, where we remove the file I added to https://jonescompneurolab.github.io/hnn-core/stable/_static/versions.json , and replace the line in doc/conf.py to link to the "dev" version of our "version file". After this point, anytime there is a new version, one will only need to update the master branch's copy of the version file, and then it will be propagated.

@asoplata asoplata force-pushed the rebuild-sphinx-pyramids branch from b85b222 to 1a57237 Compare January 21, 2025 19:33
@asoplata
Copy link
Collaborator Author

Whoops, forgot to first rebase against current master. Should be up-to-date now.

@asoplata asoplata added docs Documentation and tutorials website labels Jan 21, 2025
@jasmainak
Copy link
Collaborator

@asoplata can you share how the new website looks on your fork of jonescompneuro.github.io/hnn-core/ ?

@asoplata
Copy link
Collaborator Author

Note that, since I fixed the Makefile, one can easily see this new theme if they do another pip install -e ".[dev]", then cd doc, then make html-noplot. This will almost-instantly make the site without running all the simulations, accessible from doc/_build/html/index.html. Here are some screenshots of what the local build looks like for me:

(working version dropdown shown)
Screenshot 2025-01-21 at 4 47 02 PM

(working search shown)
Screenshot 2025-01-21 at 4 47 21 PM

(successfully-run simulations shown)
Screenshot 2025-01-21 at 4 48 01 PM

(autobuilt docs part shown)
Screenshot 2025-01-21 at 5 04 27 PM

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

Successfully merging this pull request may close these issues.

DOC: Search does not work on Sphinx-built documentation website menubar of website does not work on mobile
2 participants