Skip to content

Commit

Permalink
fix: old/leftover ids
Browse files Browse the repository at this point in the history
  • Loading branch information
salim-b committed Dec 13, 2024
1 parent b324989 commit 4f5b044
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 24 deletions.
4 changes: 2 additions & 2 deletions R/pkgsnip.gen.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ ls_file_snips <- function() {
#' [`child` document option](https://yihui.org/knitr/options/#child-documents):
#'
#' ````rmd
#' ```{r, child = pkgsnip::snip_path("installation-notice_dev-version_gitlab.Rmd")}
#' ```{r, child = pkgsnip::snip_path("pkg-instl-dev-gitlab.Rmd")}
#' ```
#' ````
#'
#' Or you can use them in roxygen2's [`@includeRmd` tag](https://roxygen2.r-lib.org/articles/rd.html#including-external--rmd-md-files):
#'
#' ```r
#' #' @includeRmd `r pkgsnip::snip_path("installation-notice_dev-version_gitlab.Rmd")`
#' #' @includeRmd `r pkgsnip::snip_path("pkg-instl-dev-gitlab.Rmd")`
#' ```
#'
#' @param id Snippet identifier. One of
Expand Down
4 changes: 2 additions & 2 deletions Rmd/pkgsnip.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,14 @@ ls_file_snips <- function() {
#' [`child` document option](https://yihui.org/knitr/options/#child-documents):
#'
#' ````rmd
#' ```{r, child = pkgsnip::snip_path("installation-notice_dev-version_gitlab.Rmd")}
#' ```{r, child = pkgsnip::snip_path("pkg-instl-dev-gitlab.Rmd")}
#' ```
#' ````
#'
#' Or you can use them in roxygen2's [`@includeRmd` tag](https://roxygen2.r-lib.org/articles/rd.html#including-external--rmd-md-files):
#'
#' ```r
#' #' @includeRmd `r pkgsnip::snip_path("installation-notice_dev-version_gitlab.Rmd")`
#' #' @includeRmd `r pkgsnip::snip_path("pkg-instl-dev-gitlab.Rmd")`
#' ```
#'
#' @param id Snippet identifier. One of
Expand Down
15 changes: 7 additions & 8 deletions docs/dev/articles/pkgsnip.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/dev/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pkgdown: 2.1.1
pkgdown_sha: ~
articles:
pkgsnip: pkgsnip.html
last_built: 2024-12-13T19:17Z
last_built: 2024-12-13T22:35Z
urls:
reference: https://pkgsnip.rpkg.dev/reference
article: https://pkgsnip.rpkg.dev/articles
6 changes: 3 additions & 3 deletions docs/dev/reference/snip_path.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/dev/search.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions man/snip_path.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions vignettes/pkgsnip.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,25 @@ In the following, an overview is given of what's included in this package.
The (R) Markdown file snippets can be used anywhere [(R) Markdown](https://rmarkdown.rstudio.com/) input is supported. For example, you can use them as input to
[knitr](https://yihui.org/knitr/)'s [`child` document option](https://yihui.org/knitr/options/#child-documents):

`r paste0("\x60\x60\x60\x60\n\x60\x60\x60", '{r, child = pkgsnip::snip_path("installation-notice_dev-version_gitlab.Rmd")}\n', "\x60\x60\x60\n\x60\x60\x60\x60")`
`r paste0("\x60\x60\x60\x60\n\x60\x60\x60", '{r, child = pkgsnip::snip_path("pkg-instl-dev-gitlab.Rmd")}\n', "\x60\x60\x60\n\x60\x60\x60\x60")`

When inserting snippets that require the name of the calling package like `"installation-notice_dev-version_gitlab.Rmd"`, you should either use
`pal::build_readme()` to build the `.Rmd` file or manually assign `pkg_metadata <- pal::desc_list()` to the environment passed to
When inserting snippets that require the name of the calling package like `"pkg-instl-dev-gitlab.Rmd"`, you should either use `pal::build_readme()` to build the
`.Rmd` file or manually assign `pkg_metadata <- pal::desc_list()` to the environment passed to
[`devtools::build_rmd()`](https://devtools.r-lib.org/reference/build_rmd.html) or its `...` argument respectively.

You can also use the snippets in [roxygen2](https://roxygen2.r-lib.org/)'s [`@includeRmd`
tag](https://roxygen2.r-lib.org/articles/rd.html#including-external--rmd-md-files):

``` rd
#' @includeRmd `r '\x60r pkgsnip::snip_path("rmd-package-notice.Rmd")\x60'`
#' @includeRmd `r '\x60r pkgsnip::snip_path("pkgpurl.Rmd")\x60'`
```

For snippets that require the name of the calling package, just assign `pkg_metadata` (once) before inserting the snippet(s), e.g. like this:

``` rd
#' `r "\x60r pkg_metadata <- pal::desc_list()\x60"`
#'
#' @includeRmd `r '\x60r pkgsnip::snip_path("installation-notice_dev-version.Rmd")\x60'`
#' @includeRmd `r '\x60r pkgsnip::snip_path("pkg-instl-dev.Rmd")\x60'`
```

### Available snippets
Expand Down

0 comments on commit 4f5b044

Please sign in to comment.