Repository navigation
Allow to add specific shiny-prerendered parts in HTML template - #2064
Merged
Merged
Conversation
and make sure it will skip test if pandoc is not available
Collaborator
Author
|
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
Collaborator
Author
|
@gadenbuie would that work for you too ? |
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
This file contains hidden or 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
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-prerenderedwill 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