Skip to content

Commit

Permalink
when running Rd2ex(), dontrun code will be commented out, so no need …
Browse files Browse the repository at this point in the history
…to treat those chunks differently
  • Loading branch information
yihui committed Oct 25, 2012
1 parent 9e2ccc6 commit 4d6a292
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions R/utils-rd2html.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ knit_rd = function(pkg, links = tools::findHTMLlinks(), frame = TRUE) {
ex = readLines(ef, warn = FALSE)
ex = ex[-(1L:grep('### ** Examples', ex, fixed = TRUE))]
ex = c('```{r}', ex, '```')
ex = gsub('^(## Not run:\\s*)', '```{r eval=FALSE}\n\\1', ex)
ex = gsub('^(## End\\(Not run\\)\\s*)', '\\1\n```{r}', ex)
opts_chunk$set(fig.path = str_c('figure/', p, '-'), tidy = FALSE)
ex = knit2html(text = ex, envir = parent.frame(2), fragment.only = TRUE)
txt = c(txt[1:i0], ex, txt[i1:length(txt)])
Expand Down

0 comments on commit 4d6a292

Please sign in to comment.