Skip to content

Commit

Permalink
Add CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
jrdnbradford committed Jul 5, 2024
1 parent 0b3edb0 commit 7ccf98c
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 19 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/dataset-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ on:
paths:
- 'data-raw/generate_data.R'
- 'data-raw/corpus/*'
- 'CHANGELOG.qmd'
pull_request:
paths:
- 'data-raw/generate_data.R'
- 'data-raw/corpus/*'
- 'CHANGELOG.qmd'

name: dataset-check

Expand Down Expand Up @@ -37,15 +39,29 @@ jobs:
any::usethis
any::dplyr
any::readr
any::tibble
any::roxygen2
any::lubridate
extra-packages:
local::.

- name: Run Rscript
- name: Generate datasets and docs
run: Rscript 'data-raw/generate_data.R'

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: 1.6.1

- name: Render CHANGELOG
uses: quarto-dev/quarto-actions/render@v2
with:
path: CHANGELOG.qmd

- name: Update pull request
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Regenerate datasets and/or dataset documentation
file_pattern: 'R/data.R data/*.rda'
file_pattern: 'R/data.R data/*.rda CHANGELOG.md'
74 changes: 74 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# {lovecraftr} Changelog


<!-- CHANGELOG.md is rendered from CHANGELOG.qmd. Do not edit CHANGELOG.md by hand. -->

| Dataset | Raw Last Updated | Dataset Last Updated |
|:-------------------------------------------------------|:--------------------|:---------------------|
| AT THE MOUNTAINS OF MADNESS | 2024-07-04 20:27:18 | 2024-07-04 20:27:18 |
| AZATHOTH | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| BEYOND THE WALL OF SLEEP | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| CELEPHAIS | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| COOL AIR | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| DAGON | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| DREAMS IN THE WITCH-HOUSE | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| EX OBLIVIONE | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| FACTS CONCERNING THE LATE ARTHUR JERMYN AND HIS FAMILY | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| FROM BEYOND | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| HE | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| HERBERT WEST: REANIMATOR | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| HYPNOS | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| IMPRISONED WITH THE PHARAOHS | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| IN THE VAULT | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| MEDUSA’S COIL | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| MEMORY | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| NYARLATHOTEP | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| PICKMAN’S MODEL | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| POETRY OF THE GODS | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| POLARIS | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE ALCHEMIST | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE BEAST IN THE CAVE | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE BOOK | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE CALL OF CTHULHU | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE CASE OF CHARLES DEXTER WARD | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE CATS OF ULTHAR | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE COLOUR OUT OF SPACE | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE CRAWLING CHAOS | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE DESCENDANT | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE DOOM THAT CAME TO SARNATH | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE DREAM QUEST OF UNKNOWN KADATH | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE DUNWICH HORROR | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE EVIL CLERGYMAN | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE FESTIVAL | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE HAUNTER OF THE DARK | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE HORROR AT MARTIN’S BEACH | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE HORROR AT RED HOOK | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE HOUND | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE LURKING FEAR | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE MOON BOG | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE MUSIC OF ERICH ZANN | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE NAMELESS CITY | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE OTHER GODS | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE OUTSIDER | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE PICTURE IN THE HOUSE | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE QUEST OF IRANON | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE RATS IN THE WALLS | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE SHADOW OUT OF TIME | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE SHADOW OVER INNSMOUTH | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE SHUNNED HOUSE | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE SILVER KEY | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE STATEMENT OF RANDOLPH CARTER | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE STRANGE HIGH HOUSE IN THE MIST | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE STREET | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE TEMPLE | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE TERRIBLE OLD MAN | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE THING ON THE DOORSTEP | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE TOMB | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE TRANSITION OF JUAN ROMERO | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE TREE | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE UNNAMABLE | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE VERY OLD FOLK | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE WHISPERER IN DARKNESS | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THE WHITE SHIP | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| THROUGH THE GATES OF THE SILVER KEY | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
| WHAT THE MOON BRINGS | 2024-06-30 15:25:18 | 2024-07-04 20:27:18 |
34 changes: 34 additions & 0 deletions CHANGELOG.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: "{lovecraftr} Changelog"
format: gfm
---
<!-- CHANGELOG.md is rendered from CHANGELOG.qmd. Do not edit CHANGELOG.md by hand. -->

```{R setup, output=FALSE, echo=FALSE, eval=TRUE}
library(dplyr)
library(tibble)
library(readr)
library(fs)
library(lubridate)
raw_files <- list.files(file.path("data-raw", "corpus"), full.names = TRUE)
titles <- read_lines(raw_files, n_max = 1)
datasets <- list.files("data", full.names = TRUE)
path_to_remove <- "data/lovecraft.rda"
datasets <- setdiff(datasets, path_to_remove)
raw_file_info <- file_info(raw_files)["modification_time"]
dataset_file_info <- file_info(datasets)["modification_time"]
raw_file_info$modification_time <- as_datetime(raw_file_info$modification_time)
dataset_file_info$modification_time <- as_datetime(dataset_file_info$modification_time)
changelog <- tibble(
Dataset = titles,
"Raw Last Updated" = raw_file_info$modification_time,
"Dataset Last Updated" = dataset_file_info$modification_time
)
```

```{R changelog, output=TRUE, echo=FALSE, eval=TRUE}
changelog %>%
knitr::kable()
```
32 changes: 18 additions & 14 deletions README.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ knitr::opts_chunk$set(

This package contains H. P. Lovecraft's corpus as R datasets for textual analysis.

## Installation

Install from [GitHub](https://github.com/jrdnbradford/lovecraftr/) using {[devtools](https://devtools.r-lib.org/)}:
```{R devtools-install, echo=TRUE, eval=TRUE}
# install.packages("devtools")
devtools::install_github("jrdnbradford/lovecraftr")
```
or {[remotes](https://remotes.r-lib.org//)}:
```{R remotes-install, echo=TRUE, eval=FALSE}
# install.packages("remotes")
remotes::install_github("jrdnbradford/lovecraftr")
```

## Usage

Character vectors of individual works can be accessed in several ways:
Expand All @@ -45,27 +58,18 @@ The entire corpus can be accessed as a tibble with:
corpus <- lovecraftr::lovecraft_corpus()
corpus |>
dplyr::filter(title == "The Call Of Cthulhu") |>
dplyr::filter(title == "THE CALL OF CTHULHU") |>
head()
```
or
```{R data-lovecraft, echo=TRUE, eval=FALSE}
data("lovecraft")
```

## Installation

Install from [GitHub](https://github.com/jrdnbradford/lovecraftr/) using {[devtools](https://devtools.r-lib.org/)}:
```{R devtools-install, echo=TRUE, eval=FALSE}
# install.packages("devtools")
devtools::install_github("jrdnbradford/lovecraftr")
```
or {[remotes](https://remotes.r-lib.org//)}:
```{R remotes-install, echo=TRUE, eval=FALSE}
# install.packages("remotes")
remotes::install_github("jrdnbradford/lovecraftr")
```

## Contributing

See [CONTRIBUTING.md](/.github/CONTRIBUTING.md).

## Changelog

See [CHANGELOG.md](/CHANGELOG.md)
4 changes: 1 addition & 3 deletions data-raw/generate_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ for (txt in corpus) {
assign(txt, text)
do.call(usethis::use_data, list(dataset_name, overwrite = TRUE))

title <- text |>
head(1) |>
stringr::str_to_title()
title <- text |> head(1)

dataset_docs <- glue::glue(docs_template)
docs <- c(docs, dataset_docs)
Expand Down

0 comments on commit 7ccf98c

Please sign in to comment.