Skip to content

Commit

Permalink
feat: add pkg-desc rmd snip
Browse files Browse the repository at this point in the history
  • Loading branch information
salim-b committed Dec 13, 2024
1 parent 9d08fb4 commit 6b7776d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ knitr::opts_knit$set(root.dir = getwd())

# `r pal::desc_value(key = "Package")`

`r paste0('[![CRAN Status](https://r-pkg.org/badges/version/', pal::desc_value(key = "Package"), ')](https://cran.r-project.org/package=', pal::desc_value(key = "Package"), '){.pkgdown-release}')`

`r pal::desc_value(key = "Description")`
```{r}
#| label: pkg-desc
#| child: !expr pkgsnip::snip_path("pkg-desc.Rmd")
```

```{r}
#| label: pkg-doc
Expand Down
21 changes: 21 additions & 0 deletions inst/snippets/pkg-desc.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
editor_options:
markdown:
references:
prefix: "pkg-desc"
---

```{r}
#| child: !expr "pkgsnip::snip_path('_common.Rmd')"
```

```{r}
#| results: asis
#| echo: false
pkg_name <- pal::desc_value(key = "Package")
pal::cat_lines(paste0("[![CRAN Status](https://r-pkg.org/badges/version/", pkg_name, ")](https://cran.r-project.org/package=", pkg_name, "){.pkgdown-release}"),
"",
pal::desc_value("Description"))
```

0 comments on commit 6b7776d

Please sign in to comment.