3030# ' vig_list[['knitr::docco_classic']][c('weave', 'tangle')]
3131NULL
3232
33- vweave = vtangle = function (file , driver , syntax , encoding = ' UTF-8' , quiet = FALSE , ... ) {
33+ vweave = function (file , driver , syntax , encoding = ' UTF-8' , quiet = FALSE , ... ) {
3434 opts_chunk $ set(error = FALSE ) # should not hide errors
3535 knit_hooks $ set(purl = hook_purl ) # write out code while weaving
3636 options(markdown.HTML.header = NULL )
@@ -39,7 +39,14 @@ vweave = vtangle = function(file, driver, syntax, encoding = 'UTF-8', quiet = FA
3939 )
4040}
4141
42- body(vtangle )[5L ] = expression(purl(file , encoding = encoding , quiet = quiet ))
42+ vtangle = function (file , ... , encoding = ' UTF-8' , quiet = FALSE ) {
43+ if (is_R_CMD_check()) {
44+ file = sub_ext(file , ' R' )
45+ file.create(file )
46+ return (file )
47+ }
48+ purl(file , encoding = encoding , quiet = quiet )
49+ }
4350
4451vweave_docco_linear = vweave
4552body(vweave_docco_linear )[5L ] = expression(knit2html(
@@ -99,11 +106,6 @@ register_vignette_engines = function(pkg) {
99106}
100107# all engines use the same tangle and package arguments, so factor them out
101108vig_engine = function (... , tangle = vtangle ) {
102- if (missing(tangle ) && is_R_CMD_check()) tangle = function (file , ... ) {
103- file = sub_ext(file , ' R' )
104- file.create(file )
105- file
106- }
107109 vig_engine0(... , tangle = tangle , package = ' knitr' , aspell = list (
108110 filter = knit_filter
109111 ))
0 commit comments