-
Notifications
You must be signed in to change notification settings - Fork 170
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
Improve book theme modularity and standardize HTML structure #576
Comments
@AakashGfude thanks for launching this effort. It will be great to kickstart defining the theme infrastructure for |
Thanks, @mmcky, for defining action points clearly. |
Heya, I would note to some extent this is a duplicate of #279. |
I think we can use this issue as a more action-focused issue to start exploring the ideas in #279 (which is long and kind-of unweildy to parse). Regarding sub-themeing An argument for continuing to use the pydata theme and modifying it to use
|
Without being very knowledgeable of re |
At present in In addition to the points above, my two cents: Reason to use pydata-sphinx-theme
Reason to use sphinx-basic-ng directlyLesser overwrites and trying to bend the code to meet your requirements. As most of the functionality and specific styles will be in the theme package itself. I agree with @choldgraf we should start off with removing bootstrap and writing our own CSS, as bootstrap is quite opinionated sometimes and has a lot of |
I would note that all four of these aspects are implemented in sphinx-book-theme, not inherited from pydata-sphinx-theme |
It should be a modular system, but I'm not suggesting putting all the plugins in different repos, all the default ones used by sphinx-book-theme, would be in the sphinx-book-theme |
I just feel that has not really been the case, since in sphinx-book-theme, we override nearly every aspect of the pydata-theme: the html templates, the css, the translations.
Yep definitely. If anything we should be inheriting from furo, which has a structure and css styling much more inline with sphinx-book-theme, than pydata-sphinx-theme |
Mostly true. But, the implementations in |
There are a few other small things which All in all, from a |
Completely agree with this. If But I think any end-user theme should inherit from this base. So Basically -- it would be great if I could write a theme without the advanced knowledge of css and html currently required. |
I was wondering this as well, it is an interesting idea! The only downside is that I'm not sure that @pradyunsg would make any promises regarding stability etc of Furo, I'm not sure he wants people to sub-theme his theme at all 😅, but I'm curious what he or others think...maybe it'd save a significant amount of time and unnecessary duplication of CSS rules? (e.g., white/black themes).
This makes me wonder if a function like this would be useful in the
I had imagined that the
I am leaning towards thinking we should just give a shot at:
|
Looks like a good action plan @choldgraf. So, should we wait for that PR https://github.com/pradyunsg/sphinx-basic-ng/pull/25/files to be merged before starting off or copy over the functionality implemented in From what I see, the end role of |
As long as others think this is a reasonable plan, then I'd say we should just give a shot at doing the conversion now. Maybe it'll turn out to be relatively quick and simple, and then we only need to "copy/paste" a single Python function from the |
As a couple of quick notes: sphinx-basic-ng's documentation is out of date. Look at the templates to figure out the exact details of how stuff works and what the knobs are. Variables starting with
Right now, it's not even possible to create a subtheme from Furo; there's hard coded checks to prevent that.
This is unlikely to change; at least, not with sphinx-basic-ng. What that is meant to do is provide reusable chunks for writing Sphinx theme templates to (a) reduce the amount of duplicated work needed for implementing things like breadcrumbs 1 (b) provide a general framework to structure your Sphinx themes with, potentially allowing for code reuse and (c) providing an opinionated but very flexible scaffold that can be overridden to whatever degree you want (just add a few styles, or redo the CSS or redo CSS and HTML). None of this eliminates the need to know a decent degree of CSS (things like making sidebars sticky, or preventing tables/code from overflowing the content container etc), but it should help reduce/remove some of the pain of trying to get a responsive scaffold. It removes/reduces a lot of figuring out how to implement $thing in your Sphinx theme as well, by providing dedicated components to use. Footnotes
|
Cool . I will start the conversion process, and see how we go. |
Cheers @AakashGfude |
I've updated the top comment to reflect some of our more recent conversations. @AakashGfude I also added you to the issue since you're focusing on this one. I'm happy to review and PRs or have discussion as needed! Also happy to help things on the sphinx-basic-ng side if we find places to upstream stuff. |
Thanks @choldgraf |
Problem statement
Our
sphinx-book-theme
has a sub-optimal underlying configuration, which makes it unnecessarily difficult to maintain, extend, and sub-theme (we care about sub-theming so that things like the quantecon theme can use the book theme as a base).Proposed solution
Update our book theme's structure so that it uses the sphinx-basic-ng theme for its basic HTML structure. This would will give us more control, flexibility, readability and reduce duplication.
It's unclear whether this should be done at the parent theme level (pydata-sphinx-theme), or if instead we should just directly sub-theme the sphinx-basic-ng theme.
Extra Background
sphinx-basic-ng is a modernized skeleton for sphinx themes. And aims to act as a base for more complicated and opinionated themes required by projects.
pydata-sphinx-theme uses the "basic" sphinx theme at present, as its base.
Our sphinx-book-theme is a sub-theme of the pydata sphinx theme.
Implementation guidance
Here's a nice mock-up of the overall theme structure that @chrisjsewell wrote up for inspiration:
Actions to take
sphinx-book-theme
that directly uses thesphinx-basic-ng
theme, but results in a nearly similar end-product (maybe with some modifications per the mock-up above)cc: @choldgraf @mmcky
ref: executablebooks/sphinx-book-theme#416 #279
The text was updated successfully, but these errors were encountered: