Skip to content

Commit

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

# By Yihui Xie (10) and others
# Via GitHub
* rstudio/main:
  Fix Pandoc nightly install in GHA (rstudio#2559)
  feat(beamer): support latex_dependencies (rstudio#2558)
  start the next version
  CRAN release 2.27
  export S3 method
  rsconnect::deploySite() has combined the arguments account and server in the doc
  Update forum url (rstudio#2555)
  Fix regression w/ image path processing from absolute to relative (rstudio#2554)
  Update posit forum URL
  provide an option to set the `*_files/` directory suffix (rstudio#2550)
  start the next version
  CRAN release v2.26
  use _PACKAGE as recommended by roxygen2
  use \describe{} instead of \itemize{} (r-devel will warn against it)
  [GHA] Remove duplicate entry in matrix
  new r-lib/actions@v2 has newer setup-pandoc
  [GHA] New setup pandoc action (rstudio#2543)
  Correctly avoid writing to the input file when there are no preserved HTML chunks (rstudio#2535)
  Create FUNDING.yml
  Fix small grammatical error (rstudio#2533)

# Conflicts:
#	DESCRIPTION
#	R/publish_site.R
  • Loading branch information
jonathan-g committed Aug 7, 2024
2 parents ca6f80b + a9497ff commit 73ec42f
Show file tree
Hide file tree
Showing 38 changed files with 265 additions and 69 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
github: [yihui]
patreon:
custom:
5 changes: 3 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ assignees: ''
---

<!--
Welcome to the rmarkdown GitHub repo!
Welcome to the rmarkdown GitHub repo !
We are always happy to hear feedback from our users.
Expand All @@ -31,4 +31,5 @@ When filing a _bug report_, please check the boxes below to confirm that you hav

- [ ] upgraded all your packages to their latest versions (including your versions of R, the RStudio IDE, and relevant R packages)?

- [ ] installed and tested your bug with the development version of the rmarkdown package using `remotes::install_github("rstudio/rmarkdown")`?
- [ ] installed and tested your bug with the development version of the rmarkdown package using `remotes::install_github("rstudio/rmarkdown")` ?

4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ contact_links:
- name: Issue guide
url: https://yihui.org/issue/
about: First time here or need a refresh? Please consult the issue guide before posting.
- name: Ask a question on RStudio Community
url: https://community.rstudio.com/c/r-markdown/10
- name: Ask a question on Posit Forum
url: https://forum.posit.co/
about: Please ask and answer questions here.
- name: Ask a question on Stack Overflow
url: https://stackoverflow.com/questions/tagged/r+r-markdown
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ assignees: ''

<!--
Welcome to the rmarkdown GitHub repo 👋
Welcome to the rmarkdown GitHub repo !
Thanks for taking the time to file a feature request! Please start by searching for an existing feature request to avoid creating duplicate requests. If you find an existing feature request, please give it a thumbs-up reaction, as we'll use these reactions to help prioritize the implementation of these features in the future.
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ jobs:
matrix:
config:
# testing R release with last shipped pandoc version in RStudio IDE and new pandoc
- {os: windows-latest, pandoc: '3.1.6.2', r: 'release'}
- {os: macOS-latest, pandoc: '3.1.6.2', r: 'release'}
- {os: windows-latest, pandoc: 'latest', r: 'release'}
- {os: macOS-latest, pandoc: 'latest', r: 'release'}
- {os: ubuntu-latest, pandoc: 'devel', r: 'release'}
# testing older pandoc versions
- {os: ubuntu-latest, pandoc: '3.1.11', r: 'release'}
- {os: ubuntu-latest, pandoc: '2.19.2', r: 'release'}
- {os: ubuntu-latest, pandoc: '2.18', r: 'release'}
- {os: ubuntu-latest, pandoc: '2.17.1.1', r: 'release'}
Expand All @@ -43,15 +44,18 @@ jobs:
- {os: ubuntu-latest, pandoc: '2.7.3', r: 'release'}
- {os: ubuntu-latest, pandoc: '2.5', r: 'release'}
# testing other R versions
- {os: ubuntu-latest, pandoc: '2.11.4', r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, pandoc: '2.11.4', r: 'oldrel-1'}
- {os: ubuntu-latest, pandoc: '2.11.4', r: 'oldrel-2'}
- {os: ubuntu-latest, pandoc: '2.11.4', r: 'oldrel-3'}
- {os: ubuntu-latest, pandoc: 'latest', r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, pandoc: 'latest', r: 'oldrel-1'}
- {os: ubuntu-latest, pandoc: 'latest', r: 'oldrel-2'}
- {os: ubuntu-latest, pandoc: 'latest', r: 'oldrel-3'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

permissions:
actions: read

steps:
- uses: actions/checkout@v3

Expand Down
8 changes: 5 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: rmarkdown
Title: Dynamic Documents for R
Version: 2.25.2.9000
Version: 2.27.1.9000
Authors@R: c(
person("JJ", "Allaire", , "[email protected]", role = "aut"),
person("Yihui", "Xie", , "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-0645-5666")),
Expand Down Expand Up @@ -84,9 +84,11 @@ Suggests:
tibble,
vctrs,
cleanrmd,
withr (>= 2.4.2)
withr (>= 2.4.2),
xml2
VignetteBuilder: knitr
Config/Needs/website: rstudio/quillt, pkgdown
Config/testthat/edition: 3
Encoding: UTF-8
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
SystemRequirements: pandoc (>= 1.14) - http://pandoc.org
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ S3method(prepare_evaluate_output,default)
S3method(prepare_evaluate_output,htmlwidget)
S3method(prepare_evaluate_output,knit_asis)
S3method(prepare_evaluate_output,list)
S3method(print,paged_df)
export(all_output_formats)
export(available_templates)
export(beamer_presentation)
Expand Down
17 changes: 16 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rmarkdown 2.26
rmarkdown 2.28
================================================================================

- `html_document` output allows `lib_dir` to point to a parent of the output
Expand All @@ -9,6 +9,19 @@ rmarkdown 2.26
child directories with RMarkdown files. #146 and #1859.
(thanks, @jonathan-g, #2199)

- `beamer_presentation` support handling latex dependencies via the new `extra_dependencies` argument and declarations within chunks (e.g., `knitr::asis_output("", meta = list(rmarkdown::latex_dependency("longtable")))`) (thanks, @cderv, @atusy, #2478).

rmarkdown 2.27
================================================================================

- Provide a global option `rmarkdown.files.suffix` to configure the suffix of the directory for auxiliary files (thanks, @certara-tzweers, #2550). By default, this suffix is `_files`, which can cause HTML output files to be deleted automatically on Microsoft OneDrive or Google Drive. If that is the case for you, you may set a different suffix in your `.Rprofile`, e.g., `options(rmarkdown.files.suffix = "_rmdfiles")`.

- Fix a regression in 2.26 regarding image paths post-processing in `html_document_base()`. Now absolute paths to image in the output directory (`output_dir`) are correctly made relative to the output directory again.


rmarkdown 2.26
================================================================================

- **rmarkdown** now requires **knitr** >= 1.43.

- Get rid of the superfluous warning in `find_pandoc()` (thanks, @jszhao, #2527).
Expand All @@ -17,6 +30,8 @@ rmarkdown 2.26

- For the output format option `fig_crop: auto`, it will now use the same logic as in **knitr** to decide if cropping is possible (yihui/knitr#2246).

- Avoid corrupting input files by accident (thanks, @J-Moravec, #2534).


rmarkdown 2.25
================================================================================
Expand Down
3 changes: 2 additions & 1 deletion R/base64.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# processes an HTML resource, given a regular expression that locates
# instances of that resource
process_html_res <- function(html, reg, processor) {
html <- one_string(html)
m <- gregexpr(reg, html, perl = TRUE, ignore.case = TRUE)
regmatches(html, m) <- lapply(regmatches(html, m), function(img_src) {
src <- sub(reg, '\\1', img_src, ignore.case = TRUE)
Expand All @@ -10,7 +11,7 @@ process_html_res <- function(html, reg, processor) {
character(1)
)
})
html
strsplit(html, "\n", fixed = TRUE)[[1]]
}

process_images <- function(html, processor) {
Expand Down
9 changes: 8 additions & 1 deletion R/beamer_presentation.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ beamer_presentation <- function(toc = FALSE,
self_contained = TRUE,
includes = NULL,
md_extensions = NULL,
pandoc_args = NULL) {
pandoc_args = NULL,
extra_dependencies = NULL) {

# base pandoc options for all beamer output
args <- c()
Expand Down Expand Up @@ -144,6 +145,12 @@ beamer_presentation <- function(toc = FALSE,
# https://github.com/rstudio/rmarkdown/issues/2294
args <- append_in_header(process_header_includes(metadata))

if (length(extra_dependencies) || has_latex_dependencies(knit_meta)) {
extra_dependencies <- latex_dependencies(extra_dependencies)
all_dependencies <- append(extra_dependencies, flatten_latex_dependencies(knit_meta))
args <- c(args, append_in_header(latex_dependencies_as_string(all_dependencies)))
}

# no-op other than caching dir location
args
}
Expand Down
7 changes: 6 additions & 1 deletion R/html_document_base.R
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,12 @@ html_document_base <- function(theme = NULL,
}

extract_preserve_chunks <- function(input_file, extract = extractPreserveChunks) {
input_str <- read_utf8(input_file)
# Don't try to modify the input file if it's not .md, otherwise the original
# input could be corrupted (#2534). In theory, preserved chunks should only
# exist in the intermediate .md file from knit(). If the .md file is not
# intermediate but original, this processing should be harmless.
if (!xfun::file_ext(input_file) %in% c('md', 'markdown')) return()
input_str <- one_string(read_utf8(input_file))
preserve <- extract(input_str)
if (!identical(preserve$value, input_str)) write_utf8(preserve$value, input_file)
preserve$chunks
Expand Down
1 change: 1 addition & 0 deletions R/html_paged.R
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ paged_table <- function(x, options = NULL) {
x
}

#' @export
print.paged_df <- function(x, ...) {
knitr::asis_output(
paged_table_html(x, options = attr(x, "options")),
Expand Down
2 changes: 1 addition & 1 deletion R/ioslides_presentation.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
#' @section Display Modes:
#' The following single character keyboard shortcuts enable alternate display
#' modes:
#' \itemize{
#' \describe{
#' \item{`'f'` }{enable fullscreen mode}
#' \item{`'w'` }{toggle widescreen mode}
#' \item{`'o'` }{enable overview mode}
Expand Down
2 changes: 1 addition & 1 deletion R/publish_site.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
#' @param site_name Name for the site (names must be unique within an account). Defaults
#' to the `name` provided by the site generator (or to the name of the site_dir if
#' there is no `name` specified).
#' @param method Publishing method (currently only "rsconnect" is available)
#' @param server Server name. Required only if you use the same account name on
#' multiple servers.
#' @param account Account to deploy application to. This parameter is only required for
#' the initial deployment of an application when there are multiple accounts configured
#' on the system.
#' @param method Publishing method (currently only "rsconnect" is available)
#' @param render `TRUE` to render the site locally before publishing.
#' @param launch_browser If `TRUE`, the system's default web browser will be launched
#' automatically after the site is deployed. Defaults to `TRUE` in interactive sessions
Expand Down
2 changes: 1 addition & 1 deletion R/render.R
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ render <- function(input,
stop2("Functions that produce HTML output found in document targeting ",
pandoc_to, " output.\nPlease change the output type ",
"of this document to HTML.\n",
"If your aiming to have some HTML widgets shown in non-HTML format as a screenshot,\n",
"If you're aiming to have some HTML widgets shown in non-HTML format as a screenshot,\n",
"please install webshot or webshot2 R package for knitr to do the screenshot, and configure it by looking at its documentation.\n",
"Alternatively, you can allow HTML output in non-HTML formats\n",
"by adding this option to the YAML front-matter of\nyour rmarkdown file:\n\n",
Expand Down
3 changes: 1 addition & 2 deletions R/rmarkdown-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@
#' \link{word_document}, \link{beamer_presentation}
#' @name rmarkdown-package
#' @aliases rmarkdown
#' @docType package
NULL
"_PACKAGE"
3 changes: 2 additions & 1 deletion R/util.R
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ file_with_meta_ext <- function(file, meta_ext, ext = xfun::file_ext(file)) {
}

knitr_files_dir <- function(file) {
paste(xfun::sans_ext(file), "_files", sep = "")
suffix <- getOption("rmarkdown.files.suffix", "_files")
paste(xfun::sans_ext(file), suffix, sep = "")
}

knitr_root_cache_dir <- function(file) {
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ You can also click "Knit to HTML" again to render the full document with all cod

There are two main places to get help:

1. The [RStudio community](https://community.rstudio.com/c/r-markdown/10) is a friendly place to ask any questions about rmarkdown and the R Markdown family of packages.
1. The [Posit community](https://forum.posit.co/c/quarto-r-markdown/10) is a friendly place to ask any questions about rmarkdown and the R Markdown family of packages.

1. [Stack Overflow](https://stackoverflow.com/questions/tagged/r-markdown) is a great source of answers to common rmarkdown questions. It is also a great place to get help, once you have created a reproducible example that illustrates your problem.

Expand Down
10 changes: 9 additions & 1 deletion man/beamer_presentation.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/ioslides_presentation.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions man/publish_site.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions man/rmarkdown-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 73ec42f

Please sign in to comment.