ropensci / bib2df

Parse a BibTeX file to a tibble
https://docs.ropensci.org/bib2df
99 stars 23 forks source link

refactor parsing to accomodate single line bib docs...contd #63

Closed jeanetteclark closed 1 month ago

jeanetteclark commented 1 month ago

continued from #62...this PR will focus on incorporating this idea:

What about allowing the user an option to add fields that then get added to the other_allowed_fields variable? Like: could you have an extra option in bib2df, say something like: extra_fields, which the user can specify as a vector of strings (the names of the extra fields they want to include).

Say, I include

bib2df(..., extra_fields=c("project","scopus")

(assume that some of my bib files have a field project, where I specify the project to which a given paper is related and a field scopus, with the URL of my Scopus page, for CV building, or something...).

giabaio commented 1 month ago

I'll merge into devel and will have to do some more tests/checks. I hope I will have some time this week to do so --- if anything, I think we have a viable branch that we can keep live --- if people need the facility is certainly there from the remotes::install_github("ropensci/bib2df", ref="devel") perspective... When all is ironed, we'll look to port it onto main and then CRAN --- hope this makes sense?

Thanks for the PR, @jeanetteclark!

jeanetteclark commented 1 month ago

That sounds good. One loose end I have not wrapped up is there is a script to write documentation of the supported fields. It would be nice to incorporate that somehow into an automatic build - but I'm not sure of what mechanism.

giabaio commented 1 month ago

Not entirely sure what you mean... Is it about documenting the spreadsheet with the relevant fields that are included by default? Do you not create a datalist file (under a specific folder data) in which for each dataset included in the package you also give all the relevant fields?

jeanetteclark commented 1 month ago

I put the csv with the data fields in inst. I decided to put it in there in case a user wants to use it directly for some reason. I put the R script that generates the help page bib2df_fields_list.R in data-raw, since it doesn't need to be user facing and really is just part of the build of the package. All of that is already pushed.

Really the only remaining thing that I would like to do at this point would be to integrate that script into an automated build process so you (or whoever the maintainer is) don't have to remember to do it manually when the fields list gets updated. I'm not exactly sure what that would look like though so I have basically tabled it. Just wanted to point it out