conig / revise

R package for writing revise and resubmits
Other
3 stars 2 forks source link

Now possible to load multiple docs into environment and get sections from them #25

Closed cjvanlissa closed 2 years ago

cjvanlissa commented 2 years ago

I think this provides all the main interface functionality I wanted to contribute. The workflow is now:

read_manuscript("manuscript1.Rmd")
read_manuscript("manuscript2.Rmd")
get_section("A_section")

And that section is automatically retrieved from one of the documents (informative warning if the section exists in both documents).

get_section() now also has an argument envir, to pass the tests (testthat does something weird with environments).

conig commented 2 years ago

Thanks, this is really useful.

I added a commit to make get_revision use the revise_errors option setting in the context of duplicate tags.

if revise_errors = TRUE, then trying to retrieve a duplicate tag found across multiple manuscripts will result in an error rather than a warning. This will protect causal users who assume everything is fine if knitr completes successfully. Power uses can still turn this behaviour off.