Skip to content

Commit 86c5a18

Browse files
committed
add a (temp.) local copy of pkgKitten::playWithPackageHelpPage()
to be replaced once pkgKitten is updated on CRAN
1 parent a52af62 commit 86c5a18

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

R/Rcpp.package.skeleton.R

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,27 @@
1717
# You should have received a copy of the GNU General Public License
1818
# along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
1919

20+
## local copy til pkgKitten is updated on CRAN
21+
.pkgKittenPlayWithPerPackageHelpPage <- function(name = "anRpackage",
22+
path = ".",
23+
maintainer = "Your Name",
24+
email = "[email protected]") {
25+
root <- file.path(path, name)
26+
helptgt <- file.path(root, "man", sprintf( "%s-package.Rd", name))
27+
helpsrc <- system.file("replacements", "manual-page-stub.Rd", package="pkgKitten")
28+
## update the package description help page
29+
if (file.exists(helpsrc)) {
30+
lines <- readLines(helpsrc)
31+
lines <- gsub("__placeholder__", name, lines, fixed = TRUE)
32+
lines <- gsub("Who to complain to <[email protected]>",
33+
sprintf( "%s <%s>", maintainer, email),
34+
lines, fixed = TRUE)
35+
writeLines(lines, helptgt)
36+
}
37+
invisible(NULL)
38+
}
39+
40+
2041
Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
2142
environment = .GlobalEnv,
2243
path = ".", force = FALSE,
@@ -120,7 +141,8 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
120141

121142
## update the package description help page
122143
if (havePkgKitten) { # if pkgKitten is available, use it
123-
pkgKitten::playWithPerPackageHelpPage(name, path, maintainer, email)
144+
#pkgKitten::playWithPerPackageHelpPage(name, path, maintainer, email)
145+
.pkgKittenPlayWithPerPackageHelpPage(name, path, maintainer, email)
124146
} else {
125147
package_help_page <- file.path(root, "man", sprintf( "%s-package.Rd", name))
126148
if (file.exists(package_help_page)) {

0 commit comments

Comments
 (0)