Skip to content

Commit

Permalink
Add credit info to PR instructions (#731)
Browse files Browse the repository at this point in the history
* Add credit info to PR instructions

Add credit block and use (at least part of) it. Other bits will hopefully be used in ttpost.

* Add credit to PR checklist

* Add credit to this week's submission

In the yaml.
  • Loading branch information
jonthegeek authored Aug 17, 2024
1 parent 21b48f6 commit c086380
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/pr_instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ We hope to provide instructions for other programming languages eventually.
3. `{dataset}.md`: Edit the `{dataset}.md` files to describe your datasets. There should be one file for each of your datasets. You most likely only need to edit the "description" column to provide a description of each variable.
4. `intro.md`: Edit the `intro.md` file to describe your dataset. You don't need to add a `# Title` at the top; this is just a paragraph or two to introduce the week.
5. Find at least one image for your dataset, and ideally two. These often come from the article about your dataset. If you can't find an image, create an example data visualization, and save that. Save the images in your folder as `png` files.
6. `meta.yaml`: Edit `meta.yaml` to provide information about your dataset.
6. `meta.yaml`: Edit `meta.yaml` to provide information about your dataset. Also provide information about how we can credit you in the `credit` block, and delete lines from this block that do not apply to you.

### Submit your pull request with the data

Expand Down
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ Preparation:
- [ ] I edited the `intro.md` file to introduce my dataset.
- [ ] I included at least one image for my dataset as a `png` file.
- [ ] I completed the information in `meta.yaml`, including descriptive alt text for each image.
- [ ] I provided information in `meta.yaml` about how to credit me, and deleted any parts of that block that I do not want you to use.
4 changes: 3 additions & 1 deletion data/2024/2024-08-20/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ data_source:
title: A list of Monarchs by marriage
url: https://www.ianvisits.co.uk/articles/a-list-of-monarchs-by-marriage-6857/
images:
# Please include at least one image, and up to three images
- file: gg_enmoma.png
alt: Chart showing the relationship between the year of marriage and the age of king/consort. The x-axis lists the years and the y-axis represents the age range. The chart indicates that the average age of marriage for a consort being much lower than king's age
credit:
post: f. hull
github: https://github.com/frankiethull
4 changes: 2 additions & 2 deletions data/curated/template/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ If you have not yet set up your computer for submitting a dataset, please see th
- Run the first line of `saving.R` to create the functions we'll use to save your dataset.
- Provide the name of your directory as `dir_name`.
- Use `ttsave()` for each dataset you created in `cleaning.R`, substituting the name fo the dataset for `YOUR_DATASET_DF`.
3. `{dataset}.md`: Edit the `{dataset}.md` files to describe your datasets. There should be one file for each dataset saved in step 5. Most likely you only need to fill in the "description" column with a description of each variable.
3. `{dataset}.md`: Edit the `{dataset}.md` files to describe your datasets. There should be one file for each of your datasets. You most likely only need to edit the "description" column to provide a description of each variable.
4. `intro.md`: Edit the `intro.md` file to describe your dataset. You don't need to add a `# Title` at the top; this is just a paragraph or two to introduce the week.
5. Find at least one image for your dataset, and ideally two. These often come from the article about your dataset. If you can't find an image, create an example data visualization, and save that. Save the images in your folder as `png` files.
6. `meta.yaml`: Edit `meta.yaml` to provide information about your dataset.
6. `meta.yaml`: Edit `meta.yaml` to provide information about your dataset. Also provide information about how we can credit you in the `credit` block, and delete lines from this block that do not apply to you.

### Submit your pull request with the data

Expand Down
6 changes: 6 additions & 0 deletions data/curated/template/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ images:
alt: ALT TEXT FOR FIRST IMAGE; SHOULD SERVE AS A REPLACEMENT FOR THE IMAGE, NOT DESCRIBE THE IMAGE
- file: FILENAME.png
alt: ALT TEXT FOR FIRST IMAGE; SHOULD SERVE AS A REPLACEMENT FOR THE IMAGE, NOT DESCRIBE THE IMAGE
credit:
# If you do not want a particular type of credit, please delete the related line
post: YOUR NAME AND AFFILIATION FOR CREDIT IN POST
linkedin: https://www.linkedin.com/in/YOURNAME
mastodon: @YOURNAME@YOURSERVER
github: https://github.com/YOURNAME
21 changes: 21 additions & 0 deletions static/templates/assign_week.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@ data_title <- metadata$data_source$title %||% stop("missing data")
data_link <- metadata$data_source$url %||% stop("missing data")
article_title <- metadata$article$title %||% stop("missing data")
article_link <- metadata$article$url %||% stop("missing data")
credit <- metadata$credit$post
credit_github <- metadata$credit$github
if (length(credit_github)) {
# Normalize in case they gave full path vs just handle or included @.
credit_handle <- sub("github.com", "", credit_github) |>
sub("https://", "", x = _) |>
gsub("/", "", x = _) |>
sub("@", "", x = _)
credit_github <- glue::glue("https://github.com/{credit_handle}")
if (length(credit)) {
credit <- glue::glue("[credit]({credit_github})")
} else {
credit <- glue::glue("@credit_handle")
}
}

## Copy files ------------------------------------------------------------------

Expand All @@ -52,6 +67,12 @@ read_piece <- function(filename) {

title_line <- glue::glue("# {title}")
intro <- read_piece(fs::path(src_dir, "intro.md"))
credit_line <- glue::glue("Thank you to {credit} for curating this week's dataset.")
if (length(credit_line)) {

intro <- paste(intro, credit_line, sep = "\n\n")
}

the_data_template <- read_piece(here::here("static", "templates", "the_data.md"))
how_to_participate <- read_piece(here::here("static", "templates", "how_to_participate.md"))

Expand Down

0 comments on commit c086380

Please sign in to comment.