-
-
Notifications
You must be signed in to change notification settings - Fork 981
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
Allow to add specific shiny-prerendered parts in HTML template #2064
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
schloerke
approved these changes
Mar 3, 2021
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.
Thank you!
and make sure it will skip test if pandoc is not available
|
Easier to organize by R files as testthat use the file name as context() by default now - https://testthat.r-lib.org/reference/context.html
@gadenbuie would that work for you too ? |
gadenbuie
approved these changes
Mar 4, 2021
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.
LGTM, thank you!
cderv
added a commit
to rstudio/flexdashboard
that referenced
this pull request
Jun 22, 2021
This follows change in rstudio/rmarkdown#1942 and rstudio/rmarkdown#2064
cpsievert
pushed a commit
to rstudio/flexdashboard
that referenced
this pull request
Jun 23, 2021
* Add HEAD placeholder in html template for shiny_prerendered This follows change in rstudio/rmarkdown#1942 and rstudio/rmarkdown#2064 * update NEWS
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This should fix #2060 and help solve rstudio/learnr#499 and rstudio/learnr#502 by modifying the leanr template.
Instead of adding the placeholder for head content required by
htmltools::renderDocument()
to the end of the<head>
, we check if it is already in the rendered HTML.This come with a feature to add content in a Pandoc template conditionnaly to shiny_prerendered rendering. A new pandoc variable
shiny-prerendered
will be set and pass to Pandoc that will allow$if(shiny-prerendered)$
clause in a Pandoc template.All html templates in rmarkdown gains addition of
<!-- HEAD_CONTENT -->
placeholder using this.{{ headContent() }}
is not used because we don't want to pass the all HTML file tohtmltools::htmlTemplate()
. It seemshtmltools::renderDocument()
expect this special comment token anyway, so it seems fine to use it directly.With this change, it will be a better fix for #1912 than just #1942 allow greater flexibility for template makers. This will allow learn to add the same part in the template and have html dependencies loaded where needed in the resulting html file.
cc @schloerke @gadenbuie @jcheng5