diff --git a/.Rbuildignore b/.Rbuildignore index 920288e..c308fb0 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -8,3 +8,6 @@ ^cran-comments\.md$ ^CRAN-RELEASE$ ^data-raw$ +^_pkgdown\.yml$ +^docs$ +^pkgdown$ diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..bfc9f4d --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,49 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + release: + types: [published] + workflow_dispatch: + +name: pkgdown.yaml + +permissions: read-all + +jobs: + pkgdown: + runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} + + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.5.0 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/.gitignore b/.gitignore index 807ea25..c2f15ec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .Rproj.user .Rhistory .RData +docs diff --git a/DESCRIPTION b/DESCRIPTION index 1db6fc5..06b06c5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: rocnp Title: Work with Romanian Personal Numeric Codes PNC / CNP -Version: 0.1.0.9001 +Version: 0.1.0.9002 Authors@R: person("Dragoș", "Moldovan-Grünfeld", , "dragos.mold@gmail.com", role = c("aut", "cre", "cph")) Description: A set of tools for working with Romanian personal numeric @@ -11,7 +11,7 @@ Description: A set of tools for working with Romanian personal numeric Romanian residents either at birth or when they obtain a residence permit. License: MIT + file LICENSE -URL: https://github.com/dragosmg/rocnp +URL: https://github.com/dragosmg/rocnp, https://dragosmg.github.io/rocnp/ BugReports: https://github.com/dragosmg/rocnp/issues Depends: R (>= 4.1.0) diff --git a/NEWS.md b/NEWS.md index cb9c7ee..9ca8c78 100644 --- a/NEWS.md +++ b/NEWS.md @@ -12,6 +12,7 @@ * `extract_county()` gets the county of issue. * `extract_status()` extracts the residence status. * `extract_dob()` gets the date of birth. +* Added a pkgdown website. # rocnp 0.1.0 diff --git a/README.Rmd b/README.Rmd index 7f07e2d..0788b13 100644 --- a/README.Rmd +++ b/README.Rmd @@ -22,15 +22,15 @@ knitr::opts_chunk$set( [![CRAN status](https://www.r-pkg.org/badges/version/rocnp)](https://CRAN.R-project.org/package=rocnp) -The goal of {rocnp} is to provide a set of functions for working with Romanian Personal Numeric Codes / Coduri Numerice Personale (CNP). +{rocnp} provides a set of tools for working with Romanian Personal Numeric Codes / Coduri Numerice Personale (CNP). ## Features -rocnp includes the following functionality for working with Romanian personal numeric codes (PNC / CNP): +{rocnp} includes the following: * an S3 class called `cnp`: - * implemented as a record (similar to `POSIXlt`) with `vctrs::new_rcrd()`. The implementation details are -* a constructor, `cnp()` for creating a `cnp` object + * implemented as a record (similar to `POSIXlt`) with `vctrs::new_rcrd()`. +* a constructor - `cnp()` - for creating a `cnp` object * the constructor automatically decomposes the CNP and augments it by parsing the various field * access the various components with the `extract_()` family of functions: * use `extract_sex()` for sex. diff --git a/README.md b/README.md index facf2c9..ebd9382 100644 --- a/README.md +++ b/README.md @@ -14,18 +14,17 @@ stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https:// status](https://www.r-pkg.org/badges/version/rocnp)](https://CRAN.R-project.org/package=rocnp) -The goal of {rocnp} is to provide a set of functions for working with -Romanian Personal Numeric Codes / Coduri Numerice Personale (CNP). +{rocnp} provides a set of tools for working with Romanian Personal +Numeric Codes / Coduri Numerice Personale (CNP). ## Features -rocnp includes the following functionality for working with Romanian -personal numeric codes (PNC / CNP): +{rocnp} includes the following: - an S3 class called `cnp`: - implemented as a record (similar to `POSIXlt`) with - `vctrs::new_rcrd()`. The implementation details are -- a constructor, `cnp()` for creating a `cnp` object + `vctrs::new_rcrd()`. +- a constructor - `cnp()` - for creating a `cnp` object - the constructor automatically decomposes the CNP and augments it by parsing the various field - access the various components with the `extract_()` family of diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 0000000..cd459c1 --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,4 @@ +url: https://dragosmg.github.io/rocnp/ +template: + bootstrap: 5 +