-
Notifications
You must be signed in to change notification settings - Fork 335
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
Updates for bslib > 0.5.1 #2395
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…slib_theme(pkg)` Takes precedence over `template.bootswatch`, but both are supported
hadley
reviewed
Feb 13, 2024
gadenbuie
force-pushed
the
fix/bslib-font-deps
branch
from
February 13, 2024 18:21
10310b5
to
0b51097
Compare
gadenbuie
commented
Feb 13, 2024
hadley
reviewed
Apr 4, 2024
This was referenced Apr 15, 2024
SebKrantz
pushed a commit
to SebKrantz/pkgdown
that referenced
this pull request
Jun 1, 2024
Including improved error messages and pass through to `bslib::bs_theme()`. Fixes r-lib#2393. Fixes r-lib#2376.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
This updates the logic around bslib-provided themes. Two major changes have happened in bslib:
bs_theme()
without additional arguments.bs_theme(bootswatch=)
withbs_theme(preset=)
. For backwards compatibility, both arguments are treated equally but only one may be provided.Changes
This PR updates pkgdown to adapt to the above:
If no theme is requested, pkgdown will use
preset = "default"
, restoring behavior prior to the newbs_theme()
default (in bslib v0.6.0).I added support for
template.bslib.preset
in addition to (and in front of)template.bootswatch
. This could also be namedbs_preset
or something else entirely if you want.I renamed
get_bslib_theme()
andcheck_bslib_theme()
(previously(get,check)_bootswatch_
) and I updatedcheck_bslib_theme()
to know about all built-in theme presets from bslib.I moved
check_bslib_theme()
intoget_bslib_theme()
so that the error message can report the checkedtemplate
field butget_bslib_theme()
can still return a string theme name.Finally, when a theme isn't in pkgdown's internal
bootswatch_bg
list, we now default to"light"
to avoid throwing an error.