Skip to content

Commit

Permalink
version 1.43
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui authored and cran-robot committed May 25, 2023
1 parent 9cc1a10 commit d33e12f
Show file tree
Hide file tree
Showing 31 changed files with 773 additions and 493 deletions.
29 changes: 16 additions & 13 deletions DESCRIPTION
@@ -1,7 +1,7 @@
Package: knitr
Type: Package
Title: A General-Purpose Package for Dynamic Report Generation in R
Version: 1.42
Version: 1.43
Authors@R: c(
person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")),
person("Abhraneel", "Sarma", role = "ctb"),
Expand Down Expand Up @@ -108,19 +108,21 @@ Authors@R: c(
person("Weicheng", "Zhu", role = "ctb"),
person("Wush", "Wu", role = "ctb"),
person("Zachary", "Foster", role = "ctb"),
person("Zhian N.", "Kamvar", role = "ctb", comment = c(ORCID = "0000-0003-1458-7108"))
person("Zhian N.", "Kamvar", role = "ctb", comment = c(ORCID = "0000-0003-1458-7108")),
person(given = "Posit Software, PBC", role = c("cph", "fnd"))
)
Description: Provides a general-purpose tool for dynamic report generation in R
using Literate Programming techniques.
Depends: R (>= 3.3.0)
Imports: evaluate (>= 0.15), highr, methods, yaml (>= 2.1.19), xfun (>=
0.34), tools
Suggests: markdown (>= 1.3), formatR, testit, digest, rgl (>=
0.95.1201), codetools, rmarkdown, htmlwidgets (>= 0.7),
webshot, tikzDevice (>= 0.10), tinytex, reticulate (>= 1.4),
JuliaCall (>= 0.11.1), magick, png, jpeg, gifski, xml2 (>=
1.2.0), httr, DBI (>= 0.4-1), showtext, tibble, sass, bslib,
ragg, gridSVG, styler (>= 1.2.0), targets (>= 0.6.0)
Imports: evaluate (>= 0.15), highr, methods, tools, xfun (>= 0.39),
yaml (>= 2.1.19)
Suggests: bslib, codetools, DBI (>= 0.4-1), digest, formatR, gifski,
gridSVG, htmlwidgets (>= 0.7), curl, jpeg, JuliaCall (>=
0.11.1), magick, markdown (>= 1.3), png, ragg, reticulate (>=
1.4), rgl (>= 0.95.1201), rlang, rmarkdown, sass, showtext,
styler (>= 1.2.0), targets (>= 0.6.0), testit, tibble,
tikzDevice (>= 0.10), tinytex, webshot, rstudioapi, xml2 (>=
1.2.0)
License: GPL
URL: https://yihui.org/knitr/
BugReports: https://github.com/yihui/knitr/issues
Expand All @@ -141,7 +143,7 @@ Collate: 'block.R' 'cache.R' 'utils.R' 'citation.R' 'hooks-html.R'
'utils-vignettes.R' 'zzz.R'
RoxygenNote: 7.2.3
NeedsCompilation: no
Packaged: 2023-01-20 05:51:44 UTC; yihui
Packaged: 2023-05-24 02:50:56 UTC; yihui
Author: Yihui Xie [aut, cre] (<https://orcid.org/0000-0003-0645-5666>),
Abhraneel Sarma [ctb],
Adam Vogt [ctb],
Expand Down Expand Up @@ -249,7 +251,8 @@ Author: Yihui Xie [aut, cre] (<https://orcid.org/0000-0003-0645-5666>),
Weicheng Zhu [ctb],
Wush Wu [ctb],
Zachary Foster [ctb],
Zhian N. Kamvar [ctb] (<https://orcid.org/0000-0003-1458-7108>)
Zhian N. Kamvar [ctb] (<https://orcid.org/0000-0003-1458-7108>),
Posit Software, PBC [cph, fnd]
Maintainer: Yihui Xie <xie@yihui.name>
Repository: CRAN
Date/Publication: 2023-01-25 10:20:08 UTC
Date/Publication: 2023-05-25 09:20:08 UTC
60 changes: 30 additions & 30 deletions MD5
@@ -1,75 +1,75 @@
dc010f9722094b82abc1131b46729e2d *DESCRIPTION
18c692564000316c2409ff423848752f *DESCRIPTION
fcc6203ac0d7feebd6d3935eee50afec *NAMESPACE
fc1fa075f427092bbc823e835179bbef *R/block.R
50388dd9a65dbaf76e3cdd3cab397cdc *R/cache.R
7ce6cdb0e93a3b835e5984a753fe4cd4 *R/citation.R
bc2621c11bdb89cad6c26a5efc495f31 *R/block.R
f1ce1a0e192d0cc0b8d803684ebde1fa *R/cache.R
a476fe6979a1c6640ff7a39adfa346f5 *R/citation.R
3771ee9fea520cb752a15de00a6ee926 *R/concordance.R
461f625b8beb427a0d03d9b43a775d31 *R/defaults.R
fefd1826a5874192f1c9607fb8a0a70c *R/engine.R
458226287f1d17372e15a2acad8bec86 *R/engine.R
2bd8736769f88e4e87060861992fe5a1 *R/header.R
73691d9549452b4c91bb3b27362a74b3 *R/highlight.R
ac3146904a77572f10bc89469187e5ec *R/hooks-asciidoc.R
ad8783b17b5906fc6c07f09f4d296f7b *R/hooks-chunk.R
8351360a60549d5c560dec6582db6975 *R/hooks-extra.R
1b22352a49814793ac3438ca65f3c7e5 *R/hooks-html.R
d2225e4997e3c17ebcca8f64cf3af2b1 *R/hooks-latex.R
bdba5b4beed6aff99d496bb2843ea647 *R/hooks-md.R
046a551b21848115b85b645d571f3465 *R/hooks-md.R
b6ba14a52efac7c61dbe6b52292645a1 *R/hooks-rst.R
4b7cc5acf13b4964d371f09d3b01f1d2 *R/hooks-textile.R
d099970247f697104c86564dafb6c54a *R/hooks.R
c09bea533cfef6eae7e983abdcdda569 *R/output.R
2f1acebfa23e02542778f36c6b620ddb *R/output.R
ba39aebe40fc0292b1261f626a8be600 *R/package.R
2f5f3a6487b9da7b9b27724aa3279bc8 *R/pandoc.R
62a8271ab2bb4cb847b002d2735c5761 *R/params.R
a8e5435019e281bb9e78b18dc7d429e4 *R/parser.R
f639ee378d58695468c015cdca0154a0 *R/parser.R
f3dfe64b5012fe68f420aa3cc05fee6d *R/pattern.R
ed3dba8a69c6309028cdc7d272ce4d80 *R/plot.R
6122363c72616199651c45ec3587613e *R/plot.R
bbb5dbe779aa4adcb75d1233d361b163 *R/rocco.R
64a5e41c8412f9199524a21b61ee6ab8 *R/spin.R
86dd844f81fb26de77762d8554632a7f *R/table.R
6dc103da8f6c24f96f633d3996576bec *R/table.R
ddb04ceb196da7b51d1bdbf4f78e0f63 *R/template.R
cff7000295ea6bf361f0d0f24da1e35a *R/themes.R
864dd90185fec3616cbe7de2ba03c56d *R/utils-conversion.R
f14e41660d66f3302883f037f8d68f4a *R/utils-rd2html.R
7f4ece2de5f8189f8ebba192e7b600d6 *R/utils-rd2html.R
bd25a692d9805170d01278f815e63366 *R/utils-string.R
aeb29eb209d25167087606e2f5401cd9 *R/utils-sweave.R
74a14744c7f7061522b39ed0a9555cac *R/utils-upload.R
461b10915c50bbf5d0a8baf96531e249 *R/utils-upload.R
00a6ebbbcc313a3d261e5309fdd73cf1 *R/utils-vignettes.R
a40b68b591a00001ca7becd423d58b2a *R/utils.R
fdfa68fded1758fbc868395c0ea9ded3 *R/utils.R
64580757ed828267f6976d73231f1f8f *R/zzz.R
7f3d8d5703a3ba9537ac7f99a01d1f7e *build/vignette.rds
6daf06dd281ffb03ac34aa34b7d134c0 *build/vignette.rds
5320cec79c972798fe0eb5579eb51927 *demo/00Index
a0d48f6ce89f9e1d39ee7248ff8c5511 *demo/gwidgets.R
a95e58617a42ea5ea95fa99a10f1c120 *demo/notebook.R
48a528acaa5c53e079f84920c5bff748 *inst/CITATION
3982b9421067677ea392b5cc194ce565 *inst/CITATION
a70f6f982a3c3cc343b5db3f0bb90949 *inst/NEWS.Rd
4874a71c96d939a22aa11a3f6ee0c0df *inst/bin/knit
ade128c7c01d7f8e5fa7f7318154b1b1 *inst/doc/datatables.R
4c1f26b7deb6644603d71c54cfd61bd9 *inst/doc/datatables.Rmd
4f20211d629c7c4663eeb5f0464f6cbb *inst/doc/datatables.html
8adb6fcb25ced778fd77d84577956d66 *inst/doc/datatables.html
f65d5ee8789ca5d827dfabdbfec7b881 *inst/doc/docco-classic.R
b47c340c4060c759ed158eeb0c258560 *inst/doc/docco-classic.Rmd
5c8c589aa35d93a813cfc19dbb975e42 *inst/doc/docco-classic.html
422ac4f5a8735370a06c12179190cb56 *inst/doc/docco-classic.html
d074020b55283431c52887f2040ebe6e *inst/doc/docco-linear.R
5068ad7f6dc06bdf5875a4df35e7ec15 *inst/doc/docco-linear.Rmd
79c4ee876673d4b84d38d8d50956c767 *inst/doc/docco-linear.html
a5f288f175e4b0190ea1212d2b1b2188 *inst/doc/docco-linear.html
3e4b708e32004e6634e71a946d2b7d72 *inst/doc/knit_expand.R
4774af06c0d07027763d929823c5c384 *inst/doc/knit_expand.Rmd
681b9e2a8a2bd51ceb85c95a8142f863 *inst/doc/knit_expand.html
57219a3ceaa771661616a86eac45bcd8 *inst/doc/knit_expand.html
7589790b62a05f2f0e47e5ee939ac6e6 *inst/doc/knit_print.R
2ee45ca25b0161540ce8df5288d8fa15 *inst/doc/knit_print.Rmd
8a48a063c903cfbc15528bffd934c9c1 *inst/doc/knit_print.html
7b2dc139db5eb3c525e1ef0ae3d72665 *inst/doc/knit_print.html
769d05c90e0867719cdee64025753b53 *inst/doc/knitr-html.R
824b923dd4a500fb460a2366aabfb19c *inst/doc/knitr-html.Rhtml
8cf1a20c0eeccae45629b93f1ee60afc *inst/doc/knitr-html.html
23404d775025e833ea59a5e08270fc0e *inst/doc/knitr-intro.R
89f153ccf155fca8ecb1eb304da5c29c *inst/doc/knitr-intro.Rmd
5dc55e91eb7e14d5418b2505d09afc02 *inst/doc/knitr-intro.html
c1f0cfc6404913ef714f9529d488d5f1 *inst/doc/knitr-intro.html
824209ff035524f7767a8968e79a4df6 *inst/doc/knitr-markdown.R
e25752b612a2380a1940b03cc5e953d4 *inst/doc/knitr-markdown.Rmd
d850a4bc5962c0f171706e8158575e77 *inst/doc/knitr-markdown.html
9e3702778fac69ca49bbb190f3f5496d *inst/doc/knitr-markdown.html
e2713b536f8a81e1071198c985475d5d *inst/doc/knitr-refcard.Rmd
16292ced40c4d7febe65861e473764b3 *inst/doc/knitr-refcard.pdf
6781c06ff89cee70503e47677a3bed74 *inst/doc/knitr-refcard.pdf
f16d37ed927336b920c67ce2e958ffc5 *inst/examples/README.md
80d81165446ea535b4368b5f6375d7a1 *inst/examples/Sweavel.sty
5cc86725bad53543ab7cc881a2783269 *inst/examples/child/knitr-child-a.Rnw
Expand Down Expand Up @@ -116,7 +116,7 @@ a42dd99237d78fbd0ba217973183aa32 *inst/misc/datatables.html
8b56ea1b46b9081df0bbe5ade0400869 *inst/misc/docco-classic.css
c35f590b60f24dd3cf26d0f3e0017ca5 *inst/misc/docco-classic.html
7957d35de356f1f07e4c358cc27087b3 *inst/misc/docco-template.html
1104e5cda3b8ffd9a39be39aa3d06582 *inst/misc/gWidgetsWWW2-knitr.R
f7032b8b4e7f41dbd0bfd83c7c411b84 *inst/misc/gWidgetsWWW2-knitr.R
e185911fcf189089aa9b39216c652c9c *inst/misc/knitr-template.Rhtml
8da99e02dfa98e2b973985e2beefb518 *inst/misc/knitr-template.Rmd
bdd0af9d06749374afb3d36a5916d191 *inst/misc/knitr-template.Rnw
Expand All @@ -128,8 +128,8 @@ e1bcfa4fa59e6027485d6761cef388ae *inst/misc/toggleR.js
b4b12d6702a9a341b6ccea645321c6d7 *inst/misc/tweak_bib.csv
894aacc5f6d190c563d8ec2d83eabe0d *inst/misc/vignette.css
fad3311c9fb05d4dce933eca8912e186 *inst/misc/vignette.html
a4c69528ff950bdb71e009c747ec8bf1 *inst/opencpu/apps/index.html
1e3c09e6c09fb52a337c0f539862b542 *inst/shiny/server.R
cd85d3422fa4888bda3dd955aa76c8fe *inst/opencpu/apps/index.html
a380c817783ff2f6cadcf63d1a42bfb3 *inst/shiny/server.R
797e1e356a0cfa4d0057090d54423d38 *inst/shiny/ui.R
b2f9b0d4a186b0b1869a8f6fc452e4a5 *inst/shiny/www/ace-shiny.css
531bef721eaec6a9a02a161e68997b42 *inst/shiny/www/ace-shiny.js
Expand Down Expand Up @@ -237,12 +237,12 @@ c82f1d2262daf76e9860d87eb7362d9e *man/hook_animation.Rd
caefcb554d3691e5a7c92bca5bb9db5d *man/hook_document.Rd
71300a86c312a2949bc50393772cf1c6 *man/hook_plot.Rd
7f3b313ee6f7a592d7319198d808e857 *man/image_uri.Rd
fffc0de3eab720f152c70ed61276ac05 *man/imgur_upload.Rd
701e417ae962ffc5708382c9109d0b3e *man/imgur_upload.Rd
7e498e79dfb695cb00582cf448bbab25 *man/include_graphics.Rd
8bdd9512d57176c507216419eab1858e *man/include_url.Rd
339b19fe49695c2640a3876542a13142 *man/inline_expr.Rd
3d8b2f2793a4869444669d2fba2fda6e *man/is_low_change.Rd
18a372852d952aae289f22bc42448968 *man/kable.Rd
1ab81190562281bc462b12802bb149b8 *man/kable.Rd
819cc7352c2b83219a861d1ade0959eb *man/knit.Rd
050cf2b09fb1ef171d20e760d9564b27 *man/knit2html.Rd
3902a1b3dd1b08f7a909e3ce4485df1a *man/knit2pandoc.Rd
Expand Down Expand Up @@ -304,7 +304,7 @@ f46a49e3fd4a1c142cd6336ab2ee5215 *tests/testit/test-cache.R
621fafe6a1a958b26529fc59594bcff9 *tests/testit/test-citation.R
8434ccf049db2d30d2795e1a605db098 *tests/testit/test-closure.R
f2dc0de6ec9d0c4159c4d2673301d4da *tests/testit/test-envir.R
d2d5a3b005bf73ef83c7491da4812870 *tests/testit/test-hooks-md.R
024c233a00dbdc6eabaae3f10106ee7e *tests/testit/test-hooks-md.R
c7306a791facc53dbe80cc5b6c244293 *tests/testit/test-output.R
ef2beb254ea8bcf4ff1df40b47468d5d *tests/testit/test-params.R
c71448003c4bdd77cc70d7d21ec1bf24 *tests/testit/test-parser.R
Expand All @@ -316,7 +316,7 @@ ad2678c42641605592b9380c89692c1c *tests/testit/test-plot.R
016971c2b18ede41ad47e1a0c357a5a2 *tests/testit/test-tangle.R
f7d3197f8f2938e0fef97a1468aed580 *tests/testit/test-templates.R
fb3d6b391a3bd94dcd5ca1259640fca5 *tests/testit/test-themes.R
7777cbde98bae7206173754d617b0d9a *tests/testit/test-utils.R
508709b51d53ddd0e811ebfd48c37864 *tests/testit/test-utils.R
ff5a827a3097e8f34c36d04450e15b5f *vignettes/assets/template-refcard.tex
4c1f26b7deb6644603d71c54cfd61bd9 *vignettes/datatables.Rmd
b47c340c4060c759ed158eeb0c258560 *vignettes/docco-classic.Rmd
Expand Down
24 changes: 12 additions & 12 deletions R/block.R
Expand Up @@ -55,17 +55,6 @@ call_block = function(block) {

if (opts_knit$get('progress')) print(block)

if (!is.null(params$child)) {
if (!is_blank(params[['code']]) && getOption('knitr.child.warning', TRUE)) warning(
"The chunk '", params$label, "' has the 'child' option, ",
"and this code chunk must be empty. Its code will be ignored."
)
if (!params$eval) return('')
cmds = lapply(sc_split(params$child), knit_child, options = block$params)
out = one_string(unlist(cmds))
return(out)
}

params$code = parse_chunk(params$code) # parse sub-chunk references

ohooks = opts_hooks$get()
Expand All @@ -82,6 +71,17 @@ call_block = function(block) {

params = fix_options(params) # for compatibility

if (!is.null(params$child)) {
if (!is_blank(params[['code']]) && getOption('knitr.child.warning', TRUE)) warning(
"The chunk '", params$label, "' has the 'child' option, ",
"and this code chunk must be empty. Its code will be ignored."
)
if (!params$eval) return('')
cmds = lapply(sc_split(params$child), knit_child, options = block$params)
out = one_string(unlist(cmds))
return(out)
}

# Check cache
if (params$cache > 0) {
content = c(
Expand Down Expand Up @@ -593,7 +593,7 @@ process_tangle.block = function(x) {
code = parse_chunk(code)
if (isFALSE(ev)) code = comment_out(code, params$comment, newline = FALSE)
if (opts_knit$get('documentation') == 0L) return(one_string(code))
# e.g when documentation 1 or 2 with purl()
# e.g. when documentation 1 or 2 with purl()
label_code(code, x)
}
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/cache.R
Expand Up @@ -30,7 +30,7 @@ new_cache = function() {
save(list = outname, file = paste(path, 'RData', sep = '.'), envir = knit_global())
if (!lazy) return() # everything has been saved; no need to make lazy db
# random seed is always load()ed
keys = setdiff(keys, '.Random.seed')
keys = as.character(setdiff(keys, '.Random.seed'))
getFromNamespace('makeLazyLoadDB', 'tools')(knit_global(), path, variables = keys)
}

Expand Down
1 change: 1 addition & 0 deletions R/citation.R
Expand Up @@ -63,6 +63,7 @@ write_bib = function(
) {
system.file = function(...) base::system.file(..., lib.loc = lib.loc)
citation = function(...) utils::citation(..., lib.loc = lib.loc)
x = x[nzchar(x)] # remove possible empty string
idx = mapply(system.file, package = x) == ''
if (any(idx)) {
warning('package(s) ', paste(x[idx], collapse = ', '), ' not found')
Expand Down
12 changes: 6 additions & 6 deletions R/engine.R
Expand Up @@ -87,9 +87,9 @@ engine_output = function(options, code, out, extra = NULL) {
if (length(out) != 1L) out = one_string(out)
out = sub('([^\n]+)$', '\\1\n', out)
if (options$engine == 'stata') {
out = gsub('\n+running.*profile.do', '', out)
out = sub('...\n+', '', out)
out = sub('\n. \nend of do-file\n', '', out)
out = gsub('\n+running.*profile\\.do', '', out)
out = sub('\\.\\.\\.\n+', '', out)
out = sub('\n\\. \nend of do-file\n', '', out)
}
one_string(c(
if (length(options$echo) > 1L || options$echo) knit_hooks$get('source')(code, options),
Expand Down Expand Up @@ -141,7 +141,7 @@ eng_interpreted = function(options) {

opts = get_engine_opts(options$engine.opts, engine)
# FIXME: for these engines, the correct order is options + code + file
code = if (engine %in% c('awk', 'gawk', 'sed', 'sas'))
code = if (engine %in% c('awk', 'gawk', 'sed', 'sas', 'psql', 'mysql'))
paste(code, opts) else paste(opts, code)
cmd = get_engine_path(options$engine.path, engine)
out = if (options$eval) {
Expand Down Expand Up @@ -537,7 +537,7 @@ eng_block2 = function(options) {
# helper to create engines the wrap embedded html assets (e.g. css,js)
eng_html_asset = function(prefix, postfix) {
function(options) {
out = if (options$eval && is_html_output(excludes = 'markdown')) {
out = if (options$eval && is_html_output()) {
one_string(c(prefix, options$code, postfix))
}
options$results = 'asis'
Expand All @@ -546,7 +546,7 @@ eng_html_asset = function(prefix, postfix) {
}

# include js in a script tag (ignore if not html output)
eng_js = eng_html_asset('<script type="text/javascript">', '</script>')
eng_js = eng_html_asset('<script>', '</script>')

# include css in a style tag (ignore if not html output)
eng_css = eng_html_asset('<style type="text/css">', '</style>')
Expand Down
1 change: 1 addition & 0 deletions R/hooks-md.R
Expand Up @@ -214,6 +214,7 @@ hooks_markdown = function(strict = FALSE, fence_char = '`') {
if (isTRUE(options$collapse)) {
r = sprintf('\n([%s]{3,})\n+\\1((\\{[.])?%s[^\n]*)?\n', fence_char, tolower(options$engine))
x = gsub(r, '\n', x)
x = gsub(asis_token, '', x, fixed = TRUE)
}
x = pandoc_div(x, options[['attr.chunk']], options[['class.chunk']])
if (is.null(s <- options$indent)) return(x)
Expand Down

0 comments on commit d33e12f

Please sign in to comment.