crsh / citr

RStudio Addin to Insert Markdown Citations
Other
407 stars 46 forks source link

Add ability for `tidy_bib_file()` to scan `_bookdown.yml` #87

Open shirdekel opened 3 years ago

shirdekel commented 3 years ago

Is your feature request related to a problem? Please describe. I'm working on a bookdown project, so I have multiple Rmds with citations. I'd like to import a messy central .bib file for all of these, and then clean it using tidy_bib_file().

Describe the solution you'd like I'd imagine that the solution would be that a call of tidy_bib_file() on index.Rmd would look up all the child documents through _bookdown.yml, and then apply tidy_bib_file() to each.

Describe alternatives you've considered Keeping an updated .bib file through Zotero from specific collections and manually removing entries when I remove them in the text.

Additional context This is all in the context of a PhD thesis. I'd like to either end up with one clean references.bib, or maybe separate chapter_1.bib, chapter_2.bib, etc. files if I end up converting them into articles. But I think ultimately, a central .bib file from all Zotero entries that is subsequently tidied would work best for the most contexts.

shirdekel commented 3 years ago

Since rmd_file can be a vector, perhaps the function could optionally (or automatically upon finding a _bookdown.yml file) feed the result of yaml::read_yaml("_bookdown.yml")[["rmd_files"]] into rmd_file. This will gets the relevant rmd files (In the future there might be an exported function for this from bookdown, see https://github.com/rstudio/bookdown/issues/1090).