-
Notifications
You must be signed in to change notification settings - Fork 189
Update mdbook #841
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
base: master
Are you sure you want to change the base?
Update mdbook #841
Conversation
This commit is split in two: 1) overwrite the old theme files 2) reapply void-docs' changes to the theme. The next commit applies void-docs changes. This split is done to make the git history clean and to clearly showcase which changes need to be done in the second commit. mdBook v0.4.43 was used to generate the default theme. This update has two benefits: 1. Features added in updates to mdBook made since the old theme files were commited will become available. It is possible to "backport" newer features into the old theme files, but this should be a cleaner solution. 2. It should fix building void-docs using newer versions of mdBook. The currently packaged version of mdBook (v0.4.43) has minor rendering issues.
The contents of this commit should closely follow the patch linked in the "Void's changes to mdBook's default theme" section of void-linux#840 Some things had to be adapted to the newer v0.4.43 base. Some changes include: - The warning and kbd elements were left intact in general.css - -webkit-print-color-adjust was set in the pre element to match void-docs' old theme even though the new theme's code element no longer includes it in print.css - Default code fonts were left as-is (these weren't present here in the void-docs original theme) in variables.css - Warning border was left as-is (this element wasn't present in older versions of mdBook) in variables.css - copy-button-filter variables were left as-is in variables.css - variables.css no doesn't include special prefers-color-scheme: dark noscript logic (void-docs original theme didn't have it)
I have dealt with similar issues before (1. a utility provides a default "template" file 2. a project overwrites the template file and uses the modified one 3. updates to the utility make changes to the template file which do not propagate to the project using it, because the project completely overwrites it). This is usually desirable behavior, but it means that the project will not get any new features introduced in the updates to the template and it is prone to breakage when backwards-incompatible changes get introduced (like rust-lang/mdBook#2685). I usually try to solve them by not completely overwriting the entire thing, but trying to overwrite just the part that needs to be changed. New modifications to the "template" file made by updates to the utility (here mdBook) get propagated to the project that way. There are two ways I know of to achieve this:
What do you think about this approach? |
If the approach described above gets implemented, commits following my "Reapply void-docs theme changes" commit (including the commit itself) could become the base of the patches which would be applied during build. This is another reason why I split the "rebase" into two commits. You may find that I'm overthinking this (which may be true), but my (limited) experience shows that tools like |
closes #840
I don't have much experience with HTML/CSS, feel free to take over this PR.
The first part of this PR "rebases" the theme files from base mdBook v0.4.14 to mdBook v0.4.43 (current version of
mdBook
package). This was done for several reasons:The next step is to actually fix the issues in #840. You can see my attempts in my "UNFINISHED" commit.
Things to consider after solving this issue
The
ghcr.io/void-linux/infra-mdbook
container will have to be updated.Once that's done, this line will have to be updated to point to the new container. I am not closely familiar with Void's infrastructure, more steps may be necessary.
The
void-docs
package should be revbumped once this issue gets resolved.