Skip to content

Commit

Permalink
No user-facing changes
Browse files Browse the repository at this point in the history
- use readme.qmd
- use codecov
  • Loading branch information
ElianHugh committed Oct 18, 2023
1 parent 8a4e103 commit f07e431
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 21 deletions.
5 changes: 3 additions & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
^quartools\.Rproj$
^\.Rproj\.user$
^\.github$
^README\.Rmd$
^README\.qmd$
^LICENSE\.md$
^\.lintr$
^\.lintr$
^codecov\.yml$
50 changes: 50 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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:
branches: [main, master]

name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

[![Lifecycle:
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![Codecov test
coverage](https://codecov.io/gh/ElianHugh/quartools/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ElianHugh/quartools?branch=main)
<!-- badges: end -->

*quartools* allows for the creation of quarto-compliant markdown via R
Expand Down Expand Up @@ -44,31 +46,36 @@ devtools::install_github("ElianHugh/quartools")

### My First Div

The simplest way to create a div block element with quartools is via the
`div` function. Note that the chunk configuration of `results: asis` is
not necessary.

``` r
library(quartools)
div("Hello world!")
div(
"The simplest way to create a div block element with quartools is via the `div` function.",
"Note that the chunk configuration of `results: asis` is not necessary."
)
```

<div>

Hello world!
The simplest way to create a div block element with quartools is via the
`div` function.

Note that the chunk configuration of `results: asis` is not necessary.

</div>

It is also possible to supply attributes to the div block element via
the `attr` parameter (the callout will not work on GitHub):

``` r
div("I'm a tip!", attr = ".callout-tip")
div(
"It is also possible to supply attributes to the div block element via the `attr` parameter.",
attr = ".callout-tip"
)
```

<div class="callout-tip">
<div>

I’m a tip!
> **Tip**
>
> It is also possible to supply attributes to the div block element via
> the `attr` parameter.
</div>

Expand Down
18 changes: 11 additions & 7 deletions README.Rmd → README.qmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
output: github_document
format: gfm
---

<!-- README.md is generated from README.Rmd. Please edit that file -->
Expand All @@ -8,6 +8,7 @@ output: github_document

<!-- badges: start -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![Codecov test coverage](https://codecov.io/gh/ElianHugh/quartools/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ElianHugh/quartools?branch=main)
<!-- badges: end -->

_quartools_ allows for the creation of quarto-compliant markdown via R function calls. As _quartools_ generates quarto-compliant markdown, and _not_ HTML tags, the content will work on any quarto output format.
Expand Down Expand Up @@ -37,17 +38,20 @@ devtools::install_github("ElianHugh/quartools")

### My First Div

The simplest way to create a div block element with quartools is via the `div` function. Note that the chunk configuration of `results: asis` is not necessary.

```{r example}
library(quartools)
div("Hello world!")
div(
"The simplest way to create a div block element with quartools is via the `div` function.",
"Note that the chunk configuration of `results: asis` is not necessary."
)
```

It is also possible to supply attributes to the div block element via the `attr` parameter (the callout will not work on GitHub):

```{r}
div("I'm a tip!", attr = ".callout-tip")
div(
"It is also possible to supply attributes to the div block element via the `attr` parameter.",
attr = ".callout-tip"
)
```

### Apply
Expand All @@ -57,4 +61,4 @@ We can leverage the `apply` family of functions ability to loop over list elemen
```{r}
my_favourite_letters <- letters[1L:3L]
mdapply(my_favourite_letters, div)
```
```
14 changes: 14 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
comment: false

coverage:
status:
project:
default:
target: auto
threshold: 1%
informational: true
patch:
default:
target: auto
threshold: 1%
informational: true

0 comments on commit f07e431

Please sign in to comment.