Skip to content

Commit

Permalink
Merged upstream changes from rstudio/rmarkdown.
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'rstudio/main' into jg-devel

* rstudio/main:
  Use the `fontawesome` package for the HTML dependency on Font Awesome (rstudio#2451)
  Ensure that rmarkdown::reneder() always returns invisibly (rstudio#2452)
  use knitr::is_latex_output() in case the output format name contains Pandoc extensions, e.g., `latex-smart`

# Conflicts:
#	NEWS.md
  • Loading branch information
jonathan-g committed Mar 20, 2023
2 parents 57a741d + a75dc37 commit 705817b
Show file tree
Hide file tree
Showing 21 changed files with 6 additions and 6,012 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Depends:
Imports:
bslib (>= 0.2.5.1),
evaluate (>= 0.13),
fontawesome (>= 0.5.0),
htmltools (>= 0.5.1),
jquerylib,
jsonlite,
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ rmarkdown 2.21
where there is a shared master library with css, javascript, etc. and separate
child directories with RMarkdown files. #146 and #1859.

- Now HTML output formats use the Font Awesome HTML dependency from the **fontawesome** package instead of shipping an outdated version of Font Awesome in **rmarkdown** (thanks, @rich-iannone, #2451).

rmarkdown 2.20
================================================================================
Expand Down
10 changes: 1 addition & 9 deletions R/html_dependencies.R
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,7 @@ html_dependency_accessible_code_block <- function() {
#' @rdname html-dependencies
#' @export
html_dependency_font_awesome <- function() {

htmlDependency(
"font-awesome",
"5.1.0",
src = pkg_file("rmd/h/fontawesome"),
stylesheet = c(
"css/all.css",
"css/v4-shims.css")
)
fontawesome::fa_html_dependency()
}

# Create an HTML dependency for Ionicons
Expand Down
6 changes: 3 additions & 3 deletions R/render.R
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ render <- function(input,
# if the output format is LaTeX, first convert .md to .tex, and then convert
# .tex to .pdf via latexmk() if PDF output is requested (in rmarkdown <=
# v1.8, we used to call Pandoc to convert .md to .tex and .pdf separately)
if (output_format$pandoc$keep_tex || pandoc_to %in% c("latex", "beamer")) {
if (output_format$pandoc$keep_tex || knitr::is_latex_output()) {
# do not use pandoc-citeproc if needs to build bibliography
convert(texfile, run_citeproc && !need_bibtex)
# patch the .tex output generated from the default Pandoc LaTeX template
Expand Down Expand Up @@ -1036,11 +1036,11 @@ render <- function(input,
intermediates <- setdiff(intermediates, c(input, intermediates_fig))
# did not run pandoc; returns the markdown output with attributes of the
# knitr meta data and intermediate files
structure(input,
invisible(structure(input,
knit_meta = knit_meta,
files_dir = files_dir,
intermediates_dir = intermediates_fig,
intermediates = intermediates)
intermediates = intermediates))
}
}

Expand Down
5 changes: 0 additions & 5 deletions inst/rmd/h/fontawesome/css/all.css

This file was deleted.

Loading

0 comments on commit 705817b

Please sign in to comment.