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
Add bbt_update_bib #27
Conversation
This is a starter for 10. Any advice on how best to add tests appreciated. Thanks! |
Awesome! The only things I see are
bib_file <- tempfile(fileext = ".bib")
mock_content <- sprintf('
---
bibliography: %s
---
This file contains a reference to @dunnington_etal18.
', bib_file)
rmd_file <- tempfile(fileext = ".Rmd")
readr::write_file(mock_content, rmd_file)
# run bbt_update_bib()
# expect_match(readr::read_file(bib_file), "dunnington_etal18")
unlink(c(rmd_file, bib_file)) Thank you! |
Good news, I got the tests to pass after adding your reference to Zotero and making it run, great way of testing this. There may well be other tweaks needed but happy with this from my perspective. |
Just getting this message on
|
But when testing with Ctl+Shift+E I get this 🎉 Duration: 12.5s 0 errors ✔ | 0 warnings ✔ | 0 notes ✔ R CMD check succeeded |
Thanks for this! I tweaked some details and added an RStudio addin...it's so good that I changed the recommended approach for RMarkdown integration! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating a merging this PR.
|
||
#' @rdname bbt_update_bib | ||
#' @export | ||
bbt_guess_bib_file <- function(path_rmd, encoding = "UTF-8") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to see tests ensuring sane error messages. Impressive!
bbt_update_bib()
function to save time and keystrokes #26