Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added first draft of new FSC-specific citations #107

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 58 additions & 12 deletions R/create_citation.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,30 +117,76 @@ create_citation <- function(
"\n",
"Please cite this publication as: \n",
"\n",
"AUTHOR NAME. YEAR. ",
"[AUTHOR NAME]. [YEAR]. ",
title, ". ", off_title, ", ",
"CITY, STATE. "
"[CITY], [STATE]. "
)
} else if (office != "SEFSC") {

} else if (office == "AFSC") {
cit <- paste0(
"{{< pagebreak >}} \n",
"\n",
"Please cite this publication as: \n",
"\n",
author_list, ". ", year, ". ",
title,
". North Pacific Fishery Management Council, Anchorage, AK. Available from ",
"https://www.npfmc.org/library/safe-reports/"
)

} else if (office == "NWFSC") {
cit <- paste0(
"{{< pagebreak >}} \n",
"\n",
"Please cite this publication as: \n",
"\n",
author_list, ". ", title, ".", year,
". Prepared by [COMMITTEE]. [XX] p."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this can be automated...

)

} else if (office == "PIFSC") {
cit <- paste0(
"{{< pagebreak >}} \n",
"\n",
"Please cite this publication as: \n",
"\n",
author_list, ". ", year, ". ",
title, ". NOAA Tech. Memo. [TECH MEMO NUMBER]",
", ", "[XX] p."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

)

} else if (office == "SEFSC") {
cit <- paste0(
"{{< pagebreak >}} \n",
"'{{< pagebreak >}}' \n",
"\n",
"Please cite this publication as: \n",
"\n",
author_list, ". ", year, ". ",
title, ". ", off_title, ", ",
loc_city, ", ", loc_state, ". "
"SEDAR. ", year, ". ", title, ". ",
"SEDAR, North Charleston SC. [XX] pp. ",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

"available online at: http://sedarweb.org/"
)
} else {

} else if (office == "SWFSC") {
cit <- paste0(
"{{< pagebreak >}} \n",
"\n",
"Please cite this publication as: \n",
"\n",
author_list, ", ", year, ". ", title,
". Pacific Fishery Management Council, Portland, OR. Available from https://www.pcouncil.org/stock-assessments-and-fishery-evaluation-safe-documents/."
)

} else { # this includes NEFSC
cit <- paste0(
"'{{< pagebreak >}}' \n",
"{{< pagebreak >}} \n",
"\n",
"Please cite this publication as: \n",
"\n",
"SEDAR. ", year, ". ", title,
"SEDAR, North Charleston SC. XXpp. ",
"available online at: http://sedarweb.org/"
author_list, ". ", year, ". ",
title, ". ", off_title, ", ",
loc_city, ", ", loc_state, ". "
)

}

# Add citation as .qmd to add into template
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-create_citation.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test_that("citaiton generated properly for SWFSC", {
test_that("citation generated properly for SWFSC", {
fxn_test <- create_citation(
author = c(
"Peter T. Kuriyama",
Expand All @@ -10,6 +10,6 @@ test_that("citaiton generated properly for SWFSC", {
year = 2024,
office = "SWFSC"
)
expected_output <- "{{< pagebreak >}} \n\nPlease cite this publication as: \n\nKuriyama, P.T., C.Allen Akselrud, J.P. Zwolinski, K.T. Hill. 2024. Check. NOAA Fisheries Science Center, La Jolla, CA. "
expected_output <- "{{< pagebreak >}} \n\nPlease cite this publication as: \n\nKuriyama, P.T., C.Allen Akselrud, J.P. Zwolinski, K.T. Hill, 2024. Check. Pacific Fishery Management Council, Portland, OR. Available from https://www.pcouncil.org/stock-assessments-and-fishery-evaluation-safe-documents/."
expect_equal(fxn_test, expected_output)
})
Loading