-
Notifications
You must be signed in to change notification settings - Fork 200
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
MAINT: Switch to sphinx-theme-builder #469
MAINT: Switch to sphinx-theme-builder #469
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple quick thoughts - thanks!
package.json
Outdated
"mini-css-extract-plugin": "^0.9.0", | ||
"node-sass": "^6.0.1", | ||
"optimize-css-assets-webpack-plugin": "^5.0.3", | ||
"pa11y-ci": "^2.4.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these we can likely clean out (e.g. we do not test with pa11y-ci
). Let's shoot for the minimal possible dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. need to do a thorough clean out.
@pradyunsg where do you suggest something like a https://github.com/executablebooks/sphinx-book-theme/tree/master/sphinx_book_theme/translations folder should go in terms of the layout system according to |
I think we could just put it under |
@choldgraf since we are compiling jsons to *.mo files, and |
Hurrah! I wanted to make it easier / explicit for folks to keep compiled assets and uncompiled assets separate -- and I am happy to see that this approach flagged non-CSS/JS stuff like this too! :)
I'd suggest leaving them under My heuristic for thinking about such things is: Would it be less work for reviewers if this was in a separate PR? In this case, I think the answer is a yes. It's technically where they are on Footnotes
|
I think @pradyunsg has a good intuition here - we should get this PR into a mergeable state ASAP, and we can always use follow-up PRs to clean things up if need be - those won't be nearly as disruptive from a merge conflict standpoint. |
Yes, totally agree with doing it in follow-up PRs. I guess mostly wanted to bring this issue to light here. Will create a separate issue once this is merged. I have moved the As we are importing Let me know if I should revert it. |
|
Have no idea, how to fix the pre-commit.ci failure 😢. |
Hmm maybe this is related to the "additional dependencies" config? Could we specify the extra dependency in the error message there? https://github.com/mgedmin/check-manifest#version-control-integration I wonder if @pradyunsg could weigh in on whether this is somehow related to the sphinx theme builder configuration setup 🤔 |
You don't need check-manifest anymore. That said, that looks like something that's a bit of an Ubuntu mess related to breaking |
Is that because we're not checking in programmatically generated assets into the repo anymore? If that's the case then I am +1 on removing it. |
and by extension, what does this mean for |
readme = "README.md" | ||
|
||
requires-python = ">=3.7" | ||
dependencies = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this PR now mean docutils 0.17 is supported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect we'll need to change some CSS still, so I'd assume that it won't be supported in this PR and we shouldn't bump that dependency just yet. I'm working on some HTML/CSS refactoring that I think will add support for docutils .17, but will do that as a follow-up to this PR so that we don't change too many things at the same time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh exactly, I was pretty sure that was the case; if the CSS still only covers div+class
, and not also semantic HTML, then it does not support docutils 0.17 or higher
That can be removed as well! sphinx-theme-builder determines what files to include by asking git! |
I guess that's similar to flit 👍 |
Basically, the sdist ends up being the same as a |
Yup, basically the same as flit. I'm pretty sure I copy-pasted some code for that too. |
(side comment - I think all of these more recent developments in Python packaging are pretty cool, thanks @pradyunsg for all of the work you're doing in that space :-) ) |
This is pretty cool, I will remove the MANIFEST file. |
Looks okayish to review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really nice to me! I checked out this PR locally and was able to successfully run tox -e docs-live
🎉
I've left a few (relatively minor) comments throughout, let me know what you think.
I agree that the main thing left to do is document this infrastructure so that others know what's going on. I don't think we want to block this PR on having a ton of docs. How about:
- Provide some basic information about how to build the theme locally with tox
- Provide some basic information about the sphinx-theme-builder
- Provide some basic information about the webpack and JS-specific files that you've added so others know what's going on
You can use the pydata contributor documentation for inspiration about what stuff to include.
Once we have those basic pieces there, so that the contributing documentation is "technically correct" even if not totally complete, then I think we should merge this in and start iterating in more focused PRs from there.
@@ -2,9 +2,9 @@ | |||
* Footer * | |||
*********************************************/ | |||
footer { | |||
padding-left: 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm - have you changed anything in the CSS files other than either moving them or updating their formatting in a way that doesn't change end behavior? If you have changed something, can you briefly describe what you've changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a few styles, for the margin directive in this commit 4fb5154 , which I pointed out in this comment #469 (comment). Still need to find the issue which was created for this. I will update that issue once I find it.
Co-authored-by: Chris Holdgraf <[email protected]>
…/sphinx-book-theme into sphinx-theme-builder
@choldgraf I updated the contributing guide
|
Those contributing docs look good to me 👍 - anything else you want to tackle in this PR? Otherwise I'd say we leave it open until tomorrow in case others want to make comments, and merge it in unless there are any objections. This PR touches a lot of stuff so it'd be good to get it in so that we can start iterating. |
Sounds good @choldgraf. I think I am done with any edits/additions in this PR. |
OK, I took another pass and added in one quick comment, there are likely still some things that we need to clean up but I think we can do that in follow-ups. The styles look good to me in general, but there seem to be a few tweaks to make (maybe related to docutils). I will tackle those in the refactor PR (#471) and we can hold off on closing #392 until that PR is merged as well. I'll merge this PR so that we can start iterating a bit from here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hah. I had clicked the wrong button.
$ pip install tox | ||
``` | ||
3. **Build the documentation**. You can use the following `tox` command: | ||
1. **Make your changes in `src/sphinx_book_theme/assets/`**. This folder contains all of the SCSS and Javascript that are used in this site. You should edit the files here, and they will be built and included with the site in the `sphinx_book_theme/` folder at build time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems... odd. Contributors might be modifying the templates or Python code as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point - I can take a pass at the contributing docs in general as well (or spot check other changes as needed) in #472
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @pradyunsg for pointing this out.
This PR switches to using sphinx-theme-builder, following this issue #417