-
-
Notifications
You must be signed in to change notification settings - Fork 219
Reworked vignette processing via new 'asis' driver #1394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
5993b6d
e99badf
3ce5023
2f80adb
3ae4e62
cd4d2ea
a127429
f21c87c
86440ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
2025-07-18 Dirk Eddelbuettel <[email protected]> | ||
|
||
* DESCRIPTION (Version, Date): Roll micro version and date | ||
* inst/include/Rcpp/config.h: Idem | ||
|
||
* R/asis.R (asisWeave, asisTangle): Borrowed with thanks from R.rsp | ||
and shortened / simplified to provide 'asis' vignette processor | ||
* R/zzz.R (.onLoad): Register new vignette processor | ||
* vignettes/*.asis: New files with vignette info from .Rnw files | ||
* vignettes/pdf/*.pdf: Moved to directory vignettes/ | ||
* vignettes/*.Rnw: Removed | ||
* man/asisWeave.Rd: Documentation | ||
|
||
2025-07-01 Dirk Eddelbuettel <[email protected]> | ||
|
||
* DESCRIPTION (Date, Version): Release 1.1.0 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: Rcpp | ||
Title: Seamless R and C++ Integration | ||
Version: 1.1.0 | ||
Date: 2025-07-01 | ||
Version: 1.1.0.1 | ||
Date: 2025-07-18 | ||
Authors@R: c(person("Dirk", "Eddelbuettel", role = c("aut", "cre"), email = "[email protected]", | ||
comment = c(ORCID = "0000-0001-6419-907X")), | ||
person("Romain", "Francois", role = "aut", | ||
|
@@ -35,3 +35,4 @@ BugReports: https://github.com/RcppCore/Rcpp/issues | |
MailingList: [email protected] | ||
RoxygenNote: 6.1.1 | ||
Encoding: UTF-8 | ||
VignetteBuilder: Rcpp |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
## These two functions are borrowed with grateful appreciation from the R.rsp package | ||
## by Henrik Bengtsson licensend under LPGL (>= 2.1) and somewhat simplified / shortened | ||
## feature-reduced here. Please the R.rsp for a full-featured version and documentation | ||
eddelbuettel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
##' Simple \sQuote{asis} Vignette Processor | ||
##' | ||
##' To pass pre-made pdf vignette vignettes through \dQuote{as is}, a simple vignette | ||
eddelbuettel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
##' process is added. It is derived from the more feature-complete one in the \pkg{R.rsp} | ||
##' package. To use it, add files named like the pdf file plus an appended \code{.asis} | ||
##' with the vignette metainformation and register the vignette processor, see the examples. | ||
##' | ||
##' @title Process pdf vignettes \sQuote{asis} | ||
##' @name asisWeave | ||
##' @param file character Filename to be processed | ||
##' @param ... dots Currently ignored | ||
##' @param pattern character A regular expression describing the filename pattern | ||
##' @return The respective filename is returned, invisibly | ||
##' @author Henrik Bengtsson for the original versions in package \pkg{R.rsp}, | ||
##' Dirk Eddelbuettel for the shortened ones used here | ||
##' @examples | ||
##' # To register this vignette engine in another package, add | ||
##' # \code{VignetteBuilder: Rcpp} as well as \code{Suggests: Rcpp} to \code{DESCRIPTON} | ||
##' # which uses the registration this package provides via | ||
##' \dontrun{tools::vignetteEngine("asis", package = pkgname, pattern = "[.](pdf|html)[.]asis$", | ||
##' weave = asisWeave, tangle = asisTangle)} | ||
##' | ||
##' # Use a .asis file as in the Rcpp package, for example Rcpp-FAQ.pdf.asis has these lines: | ||
##' # %\VignetteIndexEntry{Rcpp-FAQ} | ||
##' # %\VignetteKeywords{Rcpp, FAQ, R, Cpp} | ||
##' # %\VignettePackage{Rcpp} | ||
##' # %\VignetteEncoding{UTF-8} | ||
##' # %\VignetteEngine{Rcpp::asis} | ||
asisWeave <- function (file, ...) { | ||
output <- tools::file_path_sans_ext(basename(file)) | ||
if (!file.exists(output)) { | ||
outputS <- file.path("..", "inst", "doc", output) | ||
if (file.exists(outputS)) { | ||
file.copy(outputS, output, overwrite = TRUE) | ||
output <- outputS | ||
} else { | ||
stop("No file to process", call. = FALSE) | ||
} | ||
} | ||
Sys.setFileTime(output, time = Sys.time()) | ||
invisible(output) | ||
} | ||
|
||
##' @rdname asisWeave | ||
asisTangle <- function (file, ..., pattern = "(|[.][^.]*)[.]asis$") { | ||
workdir <- "." | ||
filename <- basename(file) | ||
fullname <- gsub(pattern, "", filename) | ||
filenameR <- sprintf("%s.R", fullname) | ||
cat(sprintf("### This is an R script tangled from '%s'\n", filename), file = filenameR) | ||
invisible(filenameR) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
%\VignetteIndexEntry{Rcpp-FAQ} | ||
%\VignetteKeywords{Rcpp, FAQ, R, Cpp} | ||
%\VignettePackage{Rcpp} | ||
%\VignetteEncoding{UTF-8} | ||
%\VignetteEngine{Rcpp::asis} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
%\VignetteIndexEntry{Rcpp-attributes} | ||
%\VignetteKeywords{Rcpp, attributes, R, Cpp} | ||
%\VignettePackage{Rcpp} | ||
%\VignetteEncoding{UTF-8} | ||
%\VignetteEngine{Rcpp::asis} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
%\VignetteIndexEntry{Rcpp-extending} | ||
%\VignetteKeywords{Rcpp, extending, R, Cpp} | ||
%\VignettePackage{Rcpp} | ||
%\VignetteEncoding{UTF-8} | ||
%\VignetteEngine{Rcpp::asis} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
%\VignetteIndexEntry{Rcpp-introduction} | ||
%\VignetteKeywords{Rcpp, R, Cpp} | ||
%\VignettePackage{Rcpp} | ||
%\VignetteEncoding{UTF-8} | ||
%\VignetteEngine{Rcpp::asis} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
\documentclass{article} | ||
\usepackage{pdfpages} | ||
%\VignetteIndexEntry{Rcpp-JSS-2011} | ||
%\VignetteKeywords{Rcpp, foreign function interface, .Call, C++, R} | ||
%\VignettePackage{Rcpp} | ||
%\VignetteEncoding{UTF-8} | ||
|
||
\begin{document} | ||
\includepdf[pages=-, fitpaper=true]{pdf/Rcpp-jss-2011.pdf} | ||
\end{document} | ||
|
||
%\VignetteEngine{Rcpp::asis} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
%\VignetteIndexEntry{Rcpp-libraries} | ||
%\VignetteKeywords{Rcpp, Package, Library} | ||
%\VignettePackage{Rcpp} | ||
%\VignetteEncoding{UTF-8} | ||
%\VignetteEngine{Rcpp::asis} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
%\VignetteIndexEntry{Rcpp-modules} | ||
%\VignetteKeywords{Rcpp, modules, R, Cpp} | ||
%\VignettePackage{Rcpp} | ||
%\VignetteEncoding{UTF-8} | ||
%\VignetteEngine{Rcpp::asis} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
%\VignetteIndexEntry{Rcpp-package} | ||
%\VignetteKeywords{Rcpp, package, R, Cpp} | ||
%\VignettePackage{Rcpp} | ||
%\VignetteEncoding{UTF-8} | ||
%\VignetteEngine{Rcpp::asis} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
%\VignetteIndexEntry{Rcpp-quickref} | ||
%\VignetteKeywords{Rcpp, quickref, R, Cpp} | ||
%\VignettePackage{Rcpp} | ||
%\VignetteEncoding{UTF-8} | ||
%\VignetteEngine{Rcpp::asis} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
%\VignetteIndexEntry{Rcpp-sugar} | ||
%\VignetteKeywords{Rcpp, sugar, R, Cpp} | ||
%\VignettePackage{Rcpp} | ||
%\VignetteEncoding{UTF-8} | ||
%\VignetteEngine{Rcpp::asis} |
Uh oh!
There was an error while loading. Please reload this page.