-
-
Notifications
You must be signed in to change notification settings - Fork 975
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
find_external_resources
works with custom format using theme
#2494
Conversation
… step Some custom theme could use the `theme` configuration in other context that bslib theming detection. We consider that if there is an error (meaning `theme` are not what rmarkdown's format expect it to be), this is indeed not bslib
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 like a good fix to me! It's unfortunate that resolve_theme()
is tightly coupled with the themes provided by html_document()
(i.e. Bootstrap themes) (I'd even recommend renaming it resolve_bs_theme()
or resolve_base_theme()
, but understand if that's out of scope).
That said, this seems like a reasonable compromise to tryCatch(resolve_theme())
in discover_rmd_resources()
, since that use of resolve_theme()
part of what's pushing the function out of its original purpose.
I am open to make adaption to this. It was introduce specifically for bslib support, but if it can be useful to different purpose we can make adaptation. I am curious of what you have in mind (is this for your It is an internal function for now, so quite open to change IMO.
That is exactly what I was thinking. Other idea was to add an argument in |
I like both ideas! After reading more about how these functions are used I think:
Those updates wouldn't change the behavior, but I do think it would make the code easier to read and understand in the future 😃 |
I'll go with this fix for now, and think more about renaming the function. I feel |
[skip ci]
find_external_resources
on custom format using their own theme
find_external_resources
works with custom format using theme
* rstudio/main: start the next version CRAN release v2.24 shinyrmd: Safer dependency extraction from pre-rendered HTML (rstudio#2500) quote the version number per CRAN's request Add output_format_dependency() (rstudio#2462) file_scope is now correctly merged when creating output_format (rstudio#2488) Correctly run some tests only on CI start the next version CRAN release v2.23 remove broken links suggest cleanrmd for e499bf7 add news comparing version numbers with numbers is no longer allowed: https://bugs.r-project.org/show_bug.cgi?id=18548 `find_external_resources` works with custom format using `theme` (rstudio#2494) start the next version CRAN release v2.22 S3 generic/method consistency Change the code-folding button text from "Code" to "Show" (rstudio#2489) fix: bump jquery-ui to v1.13.2 to fix multiple CVEs (rstudio#2477) detecting external resources needs to consider css argument (rstudio#2486)
Merge remote-tracking branch 'rstudio/main' into jg-devel # By Yihui Xie (13) and others # Via Yihui Xie * rstudio/main: start the next version CRAN release v2.24 shinyrmd: Safer dependency extraction from pre-rendered HTML (rstudio#2500) quote the version number per CRAN's request Add output_format_dependency() (rstudio#2462) file_scope is now correctly merged when creating output_format (rstudio#2488) Correctly run some tests only on CI start the next version CRAN release v2.23 remove broken links suggest cleanrmd for e499bf7 add news comparing version numbers with numbers is no longer allowed: https://bugs.r-project.org/show_bug.cgi?id=18548 `find_external_resources` works with custom format using `theme` (rstudio#2494) start the next version CRAN release v2.22 S3 generic/method consistency Change the code-folding button text from "Code" to "Show" (rstudio#2489) fix: bump jquery-ui to v1.13.2 to fix multiple CVEs (rstudio#2477) detecting external resources needs to consider css argument (rstudio#2486) # Conflicts: # DESCRIPTION
* jg-devel: (21 commits) Updated NEWS. Patched `merge_output_format_dependency` to ensure that named elements remain in the correct order. start the next version CRAN release v2.24 shinyrmd: Safer dependency extraction from pre-rendered HTML (rstudio#2500) quote the version number per CRAN's request Add output_format_dependency() (rstudio#2462) file_scope is now correctly merged when creating output_format (rstudio#2488) Correctly run some tests only on CI start the next version CRAN release v2.23 remove broken links suggest cleanrmd for e499bf7 add news comparing version numbers with numbers is no longer allowed: https://bugs.r-project.org/show_bug.cgi?id=18548 `find_external_resources` works with custom format using `theme` (rstudio#2494) start the next version CRAN release v2.22 S3 generic/method consistency Change the code-folding button text from "Code" to "Show" (rstudio#2489) fix: bump jquery-ui to v1.13.2 to fix multiple CVEs (rstudio#2477) ...
This is fixing #2493 in a quite scoped manner.
This PR account for error when
resolve_theme()
is used in finding resources step.Some custom theme could use the
theme
configuration in other context that bslib theming detection. However,resolve_theme()
is an internal function to detect if this is a bslib theme, andcss
should be copied as resource for rendering in another folder.We consider that an error means
theme
is not what rmarkdown's format expect it to be (either a vector of string, or a non built-in boostrap 3 theme), this is indeed not a bslib and we should not copy CSS.@yihui just adding you as reviewer, if you happen to pass around here. I'll merge it otherwise as I know you are travelling