diff --git a/.github/pr_instructions.md b/.github/pr_instructions.md index ad7df6ae..3244b69e 100644 --- a/.github/pr_instructions.md +++ b/.github/pr_instructions.md @@ -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 diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index ca191e01..f0d8bab2 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -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. diff --git a/data/2024/2024-08-20/meta.yaml b/data/2024/2024-08-20/meta.yaml index 957763f8..4d222f22 100644 --- a/data/2024/2024-08-20/meta.yaml +++ b/data/2024/2024-08-20/meta.yaml @@ -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 diff --git a/data/curated/template/instructions.md b/data/curated/template/instructions.md index 3bf91870..9fb091d8 100644 --- a/data/curated/template/instructions.md +++ b/data/curated/template/instructions.md @@ -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 diff --git a/data/curated/template/meta.yaml b/data/curated/template/meta.yaml index e0d81b9b..cb2a659e 100644 --- a/data/curated/template/meta.yaml +++ b/data/curated/template/meta.yaml @@ -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 diff --git a/static/templates/assign_week.R b/static/templates/assign_week.R index 4afb5898..e8dc54aa 100644 --- a/static/templates/assign_week.R +++ b/static/templates/assign_week.R @@ -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 ------------------------------------------------------------------ @@ -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"))