-
Notifications
You must be signed in to change notification settings - Fork 201
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
ENH: Sphinx-basic-ng as the base instead of pydata-sphinx-theme #456
Conversation
@AakashGfude I would definitely check out https://github.com/executablebooks/sphinx-design/tree/main/style, which copied some bootstrap v5, BUT importantly prefixes all CSS classes (in that case with |
Thanks @AakashGfude for opening this one up so that we can provide input as you go along. A few quick questions:
|
@chrisjsewell sweet. Do you want me to setup this extension here, and use its inherited css styles instead of creating a copy for sphinx-book-theme? Sounds like a good idea. Some extra styles which are needed, I will copy over. |
Thanks @choldgraf. Pydata-sphinx-theme had webpack to process sass, js and handle npm modules. We are processing sass, js here using web-compile. But we are not installing npm modules. I am going forward with having some third-party libraries like fontawesome(scss and webfonts), stored locally. https://github.com/executablebooks/sphinx-design as mentioned by @chrisjsewell has some bootstrap classes already, so I will just use that as the base design plugin, and add styles on top of that as needed. But while keeping a prefix like At present, I am trying to steer away from
I still dont have the complete picture. At present it looks maintainable. Although, I have to copy over some code from pydata-sphinx-theme.Till now mostly for toc. I wil keep this point in mind and update as I go. Significant amount of |
Hey @AakashGfude - a few quick thoughts:
I was actually thinking we'd switch over to using NPM/webpack by re-using @pradyunsg's sphinx-theme-builder: https://sphinx-theme-builder.readthedocs.io/en/latest/ That's a theme build system that installs its own
I think that if we're going to base this theme on its own, we should start from scratch and build up the theme structure with the minimal extra CSS etc that is needed. Rather than copy/pasting everything from the PyData Theme, it might be useful to instead see if we can re-create the same look and feel but without as much CSS or HTML complexity. A good goal to shoot for is "re-create the same theme experience, but with as few lines of code + dependencies as possible". Does that make sense? Some of these might be things that we can improve iteratively, before a full theme migration happens. Maybe we can discuss and identify a few things to improve as you start to make progress?
Yep - adding the code for toggle-buttons to the left ToC will likely require us to take on some of that code. We might be able to re-use or copy over some of @pradyunsg's code for the same functionality here: https://github.com/pradyunsg/furo/blob/main/src/furo/navigation.py |
I was looking through this too. Worth giving a try I think, and using npm modules will be nice. So, I will remove
Yup, totally makes sense.
Sounds good, I think we can narrow down the web scraping from context["toctree"] and context["toc"] variables, for this particular theme from pydata-sphinx-theme code. Will contrast it with the furo code. |
@AakashGfude in the name of iterative progress rather than single gigantic re-writes, what do you think about starting off with a modular PR to use |
Modular diff sounds good. I will replace |
@AakashGfude OK cool - I'll merge in a couple of the open PRs since those will change the HTML structure a little bit, that way we won't create a bunch of rebase headaches |
By the way - here's the commit where @pradyunsg migrated the pydata theme to use the theme builder: pydata/pydata-sphinx-theme#514 |
I'm gonna close this one as it is now super out of date, and our current strategy is to instead minimify this theme and build it as a thin layer on top of the pydata theme infrastructure |
Using
sphinx-basic-ng
as the base theme instead ofpydata-sphinx-theme
as discussed in executablebooks/meta#576 .Some of the ongoing tasks:-
sphinx-basic-ng
templating recommendation :- https://github.com/pradyunsg/sphinx-basic-ng/tree/main/src/sphinx_basic_ng/theme/basic-ng/sections(I have just copied over generate_toc_html function here for now)
Will update this thread with pics of ongoing development.
cc: @mmcky @choldgraf @chrisjsewell @pradyunsg