Skip to content

Commit

Permalink
Support Codeberg
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan committed Jan 23, 2025
1 parent d2b5c2a commit 8c747ce
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 5 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
**R** citation file (`inst/CITATION`) would be generated/updated with the
information of the generated `CITATION.cff` file. **No backup copy would be
created**, for more control use `cff_write_citation()` (#79).
- `repository-code` now also recognizes [Codeberg](https://codeberg.org/) as a
valid repository (#88).

# cffr 1.1.1

Expand Down
5 changes: 3 additions & 2 deletions R/utils-cff_read.R
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ get_desc_urls <- function(pkg) {

# Clean if GitLab
issues <- gsub("/-/issues$", "", issues)
# Clean if GitHub
# Clean if GitHub and codeberg.org
issues <- gsub("/issues$", "", issues)

# Join issues and urls
Expand All @@ -223,7 +223,8 @@ get_desc_urls <- function(pkg) {
"github.com", "www.github.com",
"gitlab.com",
"r-forge.r-project.org",
"bitbucket.org"
"bitbucket.org",
"codeberg.org"
), collapse = "|")

# Extract repo url
Expand Down
1 change: 1 addition & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CRC
Cabunoc
Chue
CodeMeta
Codeberg
DOI
Decoret
Druskat
Expand Down
42 changes: 42 additions & 0 deletions inst/examples/DESCRIPTION_codeberg
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Package: options
Title: Simple, Consistent Package Options
Version: 0.3.0
Authors@R:
person(
"Doug",
"Kelkhoff",
email = "[email protected]",
role = c("aut", "cre")
)
Description:
Simple mechanisms for defining and interpreting package options. Provides
helpers for interpreting environment variables, global options, defining
default values and more.
License:
MIT + file LICENSE
URL:
https://dgkf.github.io/options/,
https://codeberg.org/dgkf/options
BugReports:
https://codeberg.org/dgkf/options/issues
Imports:
utils
Suggests:
crayon,
knitr,
rmarkdown,
roxygen2,
rcmdcheck,
pkgload,
withr,
testthat (>= 3.0.0)
Config/Needs/website:
pkgdown
Roxygen:
list(markdown = TRUE)
VignetteBuilder:
knitr
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.2
Config/testthat/edition: 3
60 changes: 60 additions & 0 deletions tests/testthat/_snaps/utils-create.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,66 @@
isbn: 978-3-319-24277-4
url: https://ggplot2.tidyverse.org

---

Code
merged
Output
cff-version: 1.2.0
message: 'To cite package "options" in publications use:'
type: software
title: 'options: Simple, Consistent Package Options'
version: 0.3.0
authors:
- family-names: Kelkhoff
given-names: Doug
email: [email protected]
abstract: Simple mechanisms for defining and interpreting package options. Provides
helpers for interpreting environment variables, global options, defining default
values and more.
repository: https://CRAN.R-project.org/package=options
repository-code: https://codeberg.org/dgkf/options
url: https://dgkf.github.io/options/
contact:
- family-names: Kelkhoff
given-names: Doug
email: [email protected]
license: MIT
doi: 10.1111/2041-210X.12469
preferred-citation:
type: article
title: 'RNeXML: A Package for Reading and Writing Richly Annotated Phylogenetic,
Character, and Trait Data in R'
authors:
- family-names: Boettiger
given-names: Carl
- family-names: Chamberlain
given-names: Scott
- family-names: Vos
given-names: Rutger
- family-names: Lapp
given-names: Hilmar
journal: Methods in Ecology and Evolution
year: '2016'
volume: '7'
doi: 10.1111/2041-210X.12469
start: '352'
end: '357'
identifiers:
- type: doi
value: 10.32614/CRAN.package.options
references:
- type: book
title: 'ggplot2: Elegant Graphics for Data Analysis'
authors:
- family-names: Wickham
given-names: Hadley
publisher:
name: Springer-Verlag New York
year: '2016'
isbn: 978-3-319-24277-4
url: https://ggplot2.tidyverse.org

---

Code
Expand Down
9 changes: 6 additions & 3 deletions vignettes/crosswalk.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ following repositories:
- [GitLab](https://about.gitlab.com/).
- [R-Forge](https://r-forge.r-project.org/).
- [Bitbucket](https://bitbucket.org/).
- [Codeberg](https://codeberg.org/).

<details>

Expand All @@ -606,7 +607,7 @@ following repositories:
```{r repository-code}
# Installed package on GitHub
cff_create("jsonlite")$`repository-code`
cat(cff_create("jsonlite")$`repository-code`)
Expand All @@ -617,9 +618,11 @@ gitlab <- system.file("examples/DESCRIPTION_gitlab", package = "cffr")
cat(cff_create(gitlab)$`repository-code`)
# Check
# Codeberg
codeberg <- system.file("examples/DESCRIPTION_codeberg", package = "cffr")
desc::desc(gitlab)
cat(cff_create(codeberg)$`repository-code`)
```

</details>
Expand Down

0 comments on commit 8c747ce

Please sign in to comment.