Skip to content

pakret doesn't populate .bib files if loaded after conflicted #30

@arnaudgallou

Description

@arnaudgallou
withr::with_tempdir({
  dir <- getwd()
  
  file.create(file.path(dir, "refs.bib"))
  
  rmd <- file.path(dir, "test.Rmd")
  readr::write_file(
    pakret:::dedent("
      ---
      bibliography: refs.bib
      ---
      
      ```{r}
      #| include: false
      library(dplyr)
      conflicted::conflicts_prefer(dplyr::filter)
      library(pakret)
      ```
      
      `r pkrt('tidyverse')`
      
      ## References
    "),
    file = rmd
  )
  
  callr::r(pakret:::render, list(input = rmd, knit_root_dir = dir))
  
  cat(readr::read_file(file.path(dir, "test.md")))
})
#> the ‘tidyverse’ package version 2.0.0 (**tidyverse?**)
#> 
#> ## References

Created on 2024-12-19 with reprex v2.1.1

conflicted actually alters the frame stack. I should probably retrieve knitr's exit frame automatically rather than using a fixed frame number when defering bib_write().

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions