Closed patrickvossler18 closed 1 year ago
I think the comments are sufficient in this case, so I've checked that box in your message above.
Thanks.
To try out this version of litr, I started by installing it:
devtools::install("litr")
But then I get the error
Error: 'render' is not an exported object from 'namespace:litr'
Looking at litr/R/, I see that no functions are defined.
So then I litr-knitted this version of create-litr.Rmd (using the last release of litr to do so):
litr::render("create-litr.Rmd")
Doing so created a valid R package, but then when I try rendering the create-rknuth.Rmd example, I get the following (showing .Rmd file on left and .html file on right):
Notice that the referencing is off by 2 (e.g. the ###"b"###
label appears two chunks after where it should).
I can see in your version of create-rknuth.html, things looked like they were fixed, so I'm guessing you had a local version working but this didn't make it into the PR?
One more small note: source-files/test-example-files should only have create-rknuth.Rmd, but currently it has create-rknuth.html and rknuth/.
This PR addresses the issue described #29 in which chunks with the options
include=False
orecho=False
causeadd_chunk_label_hyperlinks()
to incorrectly shift the location of chunks because the original implementation assumed a one to one mapping between the indexing ofidx_block
andoriginal_code
. To fix this mapping, I propose we have separate vector of indices fororiginal_code
that excludes chunks with the optionsinclude=False
orecho=False
, but is the same length asidx_block
. This way, in the loop over the detected chunks in our file, we access the elements in original code that match the elements in the raw file.To-dos:
litr::setup()
does?r-hello
example with chunks withinclude=F
orecho=F
and I will add these chunks tocreate-rknuth.Rmd
.