-
Notifications
You must be signed in to change notification settings - Fork 586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
knitr syntax #69
Comments
That's true. I just fixed the example anyway.
Closing backticks are not required before a new code chunk is opened. That's from Knuth's literate programming. Section 5.1.4 has more info about it: https://www.google.com/books/edition/Dynamic_Documents_with_R_and_knitr/fyIuDwAAQBAJ?hl=en&gbpv=1&bsq=%20literate%20programming
Either a comma or a space can serve as the separator. Thank you! |
Interesting, I wasn't familiar with this. |
I've been working on a parser for RMarkdown documents using Boost's Spirit X3 library. I'm currently using the Rmds available within this repo as a test set to make sure my code is working correctly.
In running my parser I've come across some potential typos and inconsistencies in syntax in the example documents and I wanted to clarify.
Mismatched backticks
Chunk begins with 3 backticks and ends with 4, it seems like knitr is not checking for balance between the backticks as long as there is >= 3. Oddly, for the document below RStudio gives me an unexpected token error via the linter but I don't see a similar error when creating my own test documents.
010-upload.Rmd
Chunks missing closing backticks
There are a couple of examples where there are two sequential chunks where the first is missing its closing backticks, but it is immediately followed by the start of a new chunk. The documents compile correctly but this seems wrong to me.
046-read-rforge.Rmd
056-huge-plot.Rmd
Chunks with engine and name separated by a comma
There are several documents where the chunk has a format that looks like
my understanding is that the prefered format should be
is the former syntax allowable?
029-engine-Rcpp.Rmd
058-engine-tikz.Rmd
The text was updated successfully, but these errors were encountered: