Skip to content

Commit 5993b6d

Browse files
committed
Reworked vignette processing via new 'asis' driver
1 parent 24878c8 commit 5993b6d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+97
-108
lines changed

ChangeLog

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2025-07-18 Dirk Eddelbuettel <[email protected]>
2+
3+
* DESCRIPTION (Version, Date): Roll micro version and date
4+
* inst/include/Rcpp/config.h: Idem
5+
6+
* R/asis.R (asisWeave, asisTangle): Borrowed with thanks from R.rsp
7+
and shortened / simplified to provide 'asis' vignette processor
8+
* R/zzz.R (.onLoad): Register new vignette processor
9+
* vignettes/*.asis: New files with vignette info from .Rnw files
10+
* vignettes/pdf/*.pdf: Moved to directory vignettes/
11+
* vignettes/*.Rnw: Removed
12+
113
2025-07-01 Dirk Eddelbuettel <[email protected]>
214

315
* DESCRIPTION (Date, Version): Release 1.1.0

DESCRIPTION

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: Rcpp
22
Title: Seamless R and C++ Integration
3-
Version: 1.1.0
4-
Date: 2025-07-01
3+
Version: 1.1.0.1
4+
Date: 2025-07-18
55
Authors@R: c(person("Dirk", "Eddelbuettel", role = c("aut", "cre"), email = "[email protected]",
66
comment = c(ORCID = "0000-0001-6419-907X")),
77
person("Romain", "Francois", role = "aut",
@@ -35,3 +35,4 @@ BugReports: https://github.com/RcppCore/Rcpp/issues
3535
MailingList: [email protected]
3636
RoxygenNote: 6.1.1
3737
Encoding: UTF-8
38+
VignetteBuilder: Rcpp

R/asis.R

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## These two functions are borrowed with grateful appreciation from the R.rsp package
2+
## by Henrik Bengtsson licensend under LPGL (>= 2.1) and somewhat simplified / shortened
3+
## feature-reduced here. Please the R.rsp for a full-featured version and documentation
4+
5+
asisWeave <- function (file, ...) {
6+
output <- tools::file_path_sans_ext(basename(file))
7+
if (!file.exists(output)) {
8+
outputS <- file.path("..", "inst", "doc", output)
9+
if (file.exists(outputS)) {
10+
file.copy(outputS, output, overwrite = TRUE)
11+
output <- outputS
12+
} else {
13+
stop("No file to process", call. = FALSE)
14+
}
15+
}
16+
Sys.setFileTime(output, time = Sys.time())
17+
output
18+
}
19+
20+
asisTangle <- function (file, ..., pattern = "(|[.][^.]*)[.]asis$") {
21+
workdir <- "."
22+
filename <- basename(file)
23+
fullname <- gsub(pattern, "", filename)
24+
filenameR <- sprintf("%s.R", fullname)
25+
cat(sprintf("### This is an R script tangled from '%s'\n", filename), file = filenameR)
26+
invisible(filenameR)
27+
}

R/zzz.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2009 - 2016 Dirk Eddelbuettel and Romain Francois
1+
# Copyright (C) 2009 - 2025 Dirk Eddelbuettel and Romain Francois
22
#
33
# This file is part of Rcpp.
44
#
@@ -20,7 +20,8 @@
2020
.classes_map <- new.env()
2121

2222
.onLoad <- function(libname, pkgname){
23-
new_dummyObject(.dummyInstancePointer) # nocov
24-
}
25-
23+
new_dummyObject(.dummyInstancePointer) # nocov start
2624

25+
tools::vignetteEngine("asis", package = pkgname, pattern = "[.](pdf|html)[.]asis$",
26+
weave = asisWeave, tangle = asisTangle) # nocov end
27+
}

inst/include/Rcpp/config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#define RCPP_VERSION_STRING "1.1.0"
3232

3333
// the current source snapshot (using four components, if a fifth is used in DESCRIPTION we ignore it)
34-
#define RCPP_DEV_VERSION RcppDevVersion(1,1,0,0)
35-
#define RCPP_DEV_VERSION_STRING "1.1.0.0"
34+
#define RCPP_DEV_VERSION RcppDevVersion(1,1,0,1)
35+
#define RCPP_DEV_VERSION_STRING "1.1.0.1"
3636

3737
#endif

vignettes/Rcpp-FAQ.Rnw

Lines changed: 0 additions & 10 deletions
This file was deleted.

vignettes/Rcpp-FAQ.pdf

29.4 KB
Binary file not shown.

vignettes/Rcpp-FAQ.pdf.asis

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
%\VignetteIndexEntry{Rcpp-FAQ}
2+
%\VignetteKeywords{Rcpp, FAQ, R, Cpp}
3+
%\VignettePackage{Rcpp}
4+
%\VignetteEncoding{UTF-8}
5+
%\VignetteEngine{Rcpp::asis}

vignettes/Rcpp-attributes.Rnw

Lines changed: 0 additions & 10 deletions
This file was deleted.

vignettes/Rcpp-attributes.pdf

14 KB
Binary file not shown.

0 commit comments

Comments
 (0)