-
Notifications
You must be signed in to change notification settings - Fork 235
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
Enable non-R knitr engines #1149
Comments
@nbenn just to be clear, you're suggesting that we just need to relax our restriction a little and more knitr engines should work? |
Yes, that was precisely my suggestion. Currently knitr chunks are identified by checking whether some first 3 characters are in |
I think it is fine to allow other engines as well for code fences. Inline code is more problematic, though. |
An additional use case: the new-ish |
@gadenbuie I am not sure what you mean exactly, but if you want to escape code fences, then use can use four tick marks for that in commonmark, and thus in roxygen2: #' ````
#' ```{r}
#' # comment
#' this <- 10
#' is <- this + 10
#' good <- this + is
#' ```
#' ```` |
Sorry, I've since realized the missing code I'm seeing is actually #1350 |
Still,
|
@gadenbuie the ```{embed}
man/fragments/example.Rmd
``` would produce ````md
```{r}
# comment
this <- 10
is <- this + 10
good <- this + is
```
````
but maybe highlighting is not supported for Markdown in rogygen2 though |
I'm trying to include a TikZ image in the docs of a package of mine. While looking at my options, i was delighted to see that
roxygen2
supportsknitr
code chunks. Combined with thetikz
engine support ofknitr
I thought I had all I needed to make this work. Unfortunately, currently there is a quite restrictive check in place for what is considered aknitr
code chunkroxygen2/R/markdown.R
Lines 73 to 77 in c73def4
Playing around with this a bit, I was seamlessly able to generate my TikZ image from code simply by relaxing this check a bit by including other
knitr
engines as reported byknitr::knit_engines$get()
.See also: master...nbenn:master
While I realize that
knitr
support inroxygen2
is a new and somewhat experimental addition, I was wondering whether you are open to expanding this powerful feature by allowing non-R language engines to be run. I'm happy to submit a PR if this is the case.The text was updated successfully, but these errors were encountered: