Skip to content

Commit e99badf

Browse files
committed
Document and export asisWeave and asisTangle
1 parent 5993b6d commit e99badf

File tree

5 files changed

+81
-3
lines changed

5 files changed

+81
-3
lines changed

ChangeLog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* vignettes/*.asis: New files with vignette info from .Rnw files
1010
* vignettes/pdf/*.pdf: Moved to directory vignettes/
1111
* vignettes/*.Rnw: Removed
12+
* man/asisWeave.Rd: Documentation
13+
* NAMESPACE: Export asisWeave and asisTangle
1214

1315
2025-07-01 Dirk Eddelbuettel <[email protected]>
1416

NAMESPACE

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ export(Module,
3333
cpp_object_initializer,
3434
cpp_object_dummy,
3535
Rcpp.plugin.maker,
36-
getRcppVersion
36+
getRcppVersion,
37+
asisTangle,
38+
asisWeave
3739
)
3840
S3method(print, bytes)
3941
S3method(format, Rcpp_stack_trace)

R/asis.R

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,33 @@
22
## by Henrik Bengtsson licensend under LPGL (>= 2.1) and somewhat simplified / shortened
33
## feature-reduced here. Please the R.rsp for a full-featured version and documentation
44

5+
##' Simple \sQuote{asis} Vignette Processor
6+
##'
7+
##' To pass pre-made pdf vignette vignettes through \dQuote{as is}, a simple vignette
8+
##' process is added. It is derived from the more feature-complete one in the \pkg{R.rsp}
9+
##' package. To use it, add files named like the pdf file plus an appended \code{.asis}
10+
##' with the vignette metainformation and register the vignette processor, see the examples.
11+
##'
12+
##' @title Process pdf vignettes \sQuote{asis}
13+
##' @name asisWeave
14+
##' @param file character Filename to be processed
15+
##' @param ... dots Currently ignored
16+
##' @param pattern character A regular expression describing the filename pattern
17+
##' @return The respective filename is returned, invisibly
18+
##' @author Henrik Bengtsson for the original versions in package \pkg{R.rsp},
19+
##' Dirk Eddelbuettel for the shortened ones used here
20+
##' @examples
21+
##' # To register this vignette engine use
22+
##' \dontrun{tools::vignetteEngine("asis", package = pkgname, pattern = "[.](pdf|html)[.]asis$",
23+
##' weave = asisWeave, tangle = asisTangle)}
24+
##' # and add \code{VignetteBuilder: Rcpp} as well as \code{Suggests: Rcpp} to \code{DESCRIPTON}
25+
##'
26+
##' # Use a .asis file as in the Rcpp package, for example Rcpp-FAQ.pdf.asis has these lines:
27+
##' # %\VignetteIndexEntry{Rcpp-FAQ}
28+
##' # %\VignetteKeywords{Rcpp, FAQ, R, Cpp}
29+
##' # %\VignettePackage{Rcpp}
30+
##' # %\VignetteEncoding{UTF-8}
31+
##' # %\VignetteEngine{Rcpp::asis}
532
asisWeave <- function (file, ...) {
633
output <- tools::file_path_sans_ext(basename(file))
734
if (!file.exists(output)) {
@@ -14,9 +41,10 @@ asisWeave <- function (file, ...) {
1441
}
1542
}
1643
Sys.setFileTime(output, time = Sys.time())
17-
output
44+
invisible(output)
1845
}
1946

47+
##' @rdname asisWeave
2048
asisTangle <- function (file, ..., pattern = "(|[.][^.]*)[.]asis$") {
2149
workdir <- "."
2250
filename <- basename(file)

man/asisWeave.Rd

Lines changed: 47 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/compilerCheck.Rd

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)