Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
boB Rudis 4c72712d1f
badges
pirms 4 gadiem
.github/workflows Create R-CMD-check.yml pirms 4 gadiem
R GHA pirms 4 gadiem
data-raw GHA pirms 4 gadiem
inst native pirms 4 gadiem
man GHA pirms 4 gadiem
tests R package repo initialization complete pirms 4 gadiem
.Rbuildignore GHA pirms 4 gadiem
.codecov.yml R package repo initialization complete pirms 4 gadiem
.gitignore R package repo initialization complete pirms 4 gadiem
.travis.yml R package repo initialization complete pirms 4 gadiem
CONDUCT.md R package repo initialization complete pirms 4 gadiem
DESCRIPTION GHA pirms 4 gadiem
LICENSE pkg done pirms 4 gadiem
LICENSE.md pkg done pirms 4 gadiem
NAMESPACE GHA pirms 4 gadiem
NEWS.md Fixes #1 pirms 4 gadiem
README.Rmd native pirms 4 gadiem
README.md badges pirms 4 gadiem
slugify.Rproj R package repo initialization complete pirms 4 gadiem

README.md

Project Status: Active – The project has reached a stable, usablestate and is being activelydeveloped. Signedby Signed commit% R-CMD-check Linux buildStatus
Minimal RVersion License

slugify

Create Slug Strings for SEO

Description

Most blogging platforms turn title phrases into slugs for better SEO. Tools are provided to turn phrases into slugs.

What’s Inside The Tin

The following functions are implemented:

  • slugify_native: Native R slugify (with the help of stringi)

  • slugify: Slugify a string

Installation

install.packages("slugify", repos = c("https://cinc.rud.is", "https://cloud.r-project.org/"))
# or
remotes::install_git("https://git.rud.is/hrbrmstr/slugify.git")
# or
remotes::install_git("https://git.sr.ht/~hrbrmstr/slugify")
# or
remotes::install_gitlab("hrbrmstr/slugify")
# or
remotes::install_bitbucket("hrbrmstr/slugify")
# or
remotes::install_github("hrbrmstr/slugify")

NOTE: To use the ‘remotes’ install options you will need to have the {remotes} package installed.

Usage

library(slugify)

# current version
packageVersion("slugify")
## [1] '0.2.0'
slugify("New Package — {cdccovidview} — To Work with the U.S. CDC’s New COVID-19 Trackers: COVIDView and COVID-NET")
## [1] "new-package-cdccovidview-to-work-with-the-us-cdcs-new-covid-19-trackers-covidview-and-covid-net"

slugify("New Package — {cdccovidview} — To Work with the U.S. CDC’s New COVID-19 Trackers: COVIDView and COVID-NET", replacement = "@")
## [1] "new@package@cdccovidview@to@work@with@the@us@cdcs@new@covid19@trackers@covidview@and@covidnet"

slugify("R is great!", remove = "/[Rr]/g")
## [1] "is-geat"
slugify_native("New Package — {cdccovidview} — To Work with the U.S. CDC’s New COVID-19 Trackers: COVIDView and COVID-NET")
## [1] "new-package-cdccovidview-to-work-with-the-us-cdcs-new-covid-19-trackers-covidview-and-covid-net"

slugify_native("New Package — {cdccovidview} — To Work with the U.S. CDC’s New COVID-19 Trackers: COVIDView and COVID-NET", repl = "@")
## [1] "new@package@cdccovidview@to@work@with@the@us@cdcs@new@covid-19@trackers@covidview@and@covid-net"
microbenchmark::microbenchmark(
  slugify_native("New Package — {cdccovidview} — To Work with the U.S. CDC’s New COVID-19 Trackers: COVIDView and COVID-NET"),
  slugify("New Package — {cdccovidview} — To Work with the U.S. CDC’s New COVID-19 Trackers: COVIDView and COVID-NET"),
  control = list(warmup = 10)
)
## Unit: microseconds
##                                                                                                                         expr
##  slugify_native("New Package — {cdccovidview} — To Work with the U.S. CDC’s New COVID-19 Trackers: COVIDView and COVID-NET")
##         slugify("New Package — {cdccovidview} — To Work with the U.S. CDC’s New COVID-19 Trackers: COVIDView and COVID-NET")
##      min       lq     mean   median       uq      max neval
##  294.659 310.4540 376.8535 326.3330 375.5105 1446.752   100
##  274.091 302.8215 439.2495 336.0975 476.3755 1314.823   100

slugify Metrics

Lang # Files (%) LoC (%) Blank lines (%) # Lines (%)
R 6 0.86 130 0.88 25 0.52 32 0.48
Rmd 1 0.14 18 0.12 23 0.48 35 0.52

clock Package Metrics for slugify

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.