# only run this when NOT_CRAN is true (e.g., on Travis CI) if (Sys.getenv('NOT_CRAN') == 'true') local({ all_files = function() { list.files('rmd', all.files = TRUE, full.names = TRUE) } files1 = all_files() on.exit(unlink(setdiff(all_files(), files1), recursive = TRUE), add = TRUE) for (f in list.files('rmd', '[.]Rmd$', full.names = TRUE)) { rmarkdown::render(f, envir = globalenv(), quiet = TRUE) } # split by section works correctly ## id is used for html file name sections_files = c("section-1.html", "subsection-1.html", "section-2.html", "sub2.html") if (any(!file.exists(file.path("rmd", sections_files)))) stop("Failed to generate sections files") ## reference is working correctly (see #787) if (!any(xfun::read_utf8("rmd/subsection-1.html") == '
See chapter 2 now at 2
')) stop('Failed to reference section when split by sections') if (!any(xfun::read_utf8("rmd/sub2.html") == 'See figure 2.1
')) stop('Failed to reference figure when split by sections') # Check equation label are working if (!any(readLines('rmd/equation-label.html') == 'y \\in \\mathbb{Z} \\tag{2}')) { stop('Failed to render the equation label in equation-label.Rmd') } # footnotes are parsed and moved correctly ## deleted from last section if (any(grepl('