diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 8bc9210..ed7650c 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -1,46 +1,48 @@ +# 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: master + branches: [main, master] + pull_request: + branches: [main, master] + release: + types: [published] + workflow_dispatch: name: pkgdown jobs: pkgdown: - runs-on: macOS-latest + 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@v2 + - uses: actions/checkout@v3 - - uses: r-lib/actions/setup-r@master + - uses: r-lib/actions/setup-pandoc@v2 - - uses: r-lib/actions/setup-pandoc@master - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true - - name: Cache R packages - uses: actions/cache@v1 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + extra-packages: any::pkgdown, local::. + needs: website - - name: Install dependencies - run: | - remotes::install_deps(dependencies = TRUE) - install.packages("pkgdown") + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) shell: Rscript {0} - - name: Install package - run: R CMD INSTALL . - - - name: Deploy package - run: | - git config --local user.email "actions@github.com" - git config --local user.name "GitHub Actions" - Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.4.1 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/DESCRIPTION b/DESCRIPTION index 2d676fd..36bf95e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -30,7 +30,7 @@ Imports: magrittr, tidyselect (>= 1.2.0), lifecycle -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.0 SystemRequirements: C++17 LinkingTo: Rcpp, diff --git a/R/parsermd-package.R b/R/parsermd-package.R index e9b5932..bacfe62 100644 --- a/R/parsermd-package.R +++ b/R/parsermd-package.R @@ -1,23 +1,16 @@ -#' Stuff -#' -#' @name parsermd-package -#' @aliases parsermd -#' @docType package -#' @title Stuff -#' @author Colin Rundel \email{rundel@gmail.com} -#' @keywords package -NULL +#' @keywords internal +"_PACKAGE" + ## usethis namespace: start #' @useDynLib parsermd, .registration = TRUE #' @importFrom Rcpp sourceCpp +#' @importFrom rlang .data +#' @importFrom magrittr %>% ## usethis namespace: end NULL -#' @importFrom rlang .data -NULL -#' @importFrom magrittr %>% #' @export magrittr::`%>%` diff --git a/R/print_tree.R b/R/print_tree.R index 923ee13..01c5c76 100644 --- a/R/print_tree.R +++ b/R/print_tree.R @@ -23,7 +23,6 @@ tree_node.rmd_yaml_list = function(x) { tree_node.rmd_yaml(unlist(x)) } - tree_node.rmd_heading = function(x) { list( text = "Heading", @@ -52,7 +51,6 @@ tree_node.rmd_raw_chunk = function(x) { ) } - tree_node.rmd_markdown = function(x) { list( text = "Markdown", diff --git a/_pkgdown.yml b/_pkgdown.yml index 41ce3f2..53d4af8 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,4 +1,6 @@ url: https://rundel.github.io/parsermd +template: + bootstrap: 5 navbar: type: default diff --git a/man/parsermd-package.Rd b/man/parsermd-package.Rd index ee491be..39b9b01 100644 --- a/man/parsermd-package.Rd +++ b/man/parsermd-package.Rd @@ -2,13 +2,23 @@ % Please edit documentation in R/parsermd-package.R \docType{package} \name{parsermd-package} -\alias{parsermd-package} \alias{parsermd} -\title{Stuff} +\alias{parsermd-package} +\title{parsermd: Formal Parser and Related Tools for R Markdown Documents} \description{ -Stuff +An implementation of a formal grammar and parser for R Markdown documents using the Boost Spirit X3 library. It also includes a collection of high level functions for working with the resulting abstract syntax tree. +} +\seealso{ +Useful links: +\itemize{ + \item \url{https://rundel.github.io/parsermd/} + \item \url{https://github.com/rundel/parsermd} + \item Report bugs at \url{https://github.com/rundel/parsermd/issues} +} + } \author{ -Colin Rundel \email{rundel@gmail.com} +\strong{Maintainer}: Colin Rundel \email{rundel@gmail.com} + } -\keyword{package} +\keyword{internal}