I am writing Rmdfiles representing a package whisker. And use slidifyto compile it into html slides.
Therefore, it is inevitable to use {{and in the code }}. I wrote the following code in a file Rmd:
```{r}
tpl <- "
<b>Against:</b> {{x.against}}<br/>
<b>Venue:</b> {{x.venue}}<br/>
<b>Match:</b> {{x.type}}<br/>
<b>Score:</b> {{x.score}}<br/>
<b>Result:</b> <span class={{x.result}}>{{x.result}}</span><br/>
{{#x.sr}}<b>Strike Rate:</b> {{x.sr}} {{/x.sr}}
"
```
But in the analyzed file, htmlcurly braces and contents inside are ignored:
<pre><code class="r">tpl <- "
<b>Against:</b> <br/>
<b>Venue:</b> <br/>
<b>Match:</b> <br/>
<b>Score:</b> <br/>
<b>Result:</b> <span class=></span><br/>
"
</code></pre>
It is not possible to write html directly in a file Rmdfor codes. Option results='asis'c knitronly affects the output, and not the code fragment.
Is there any solution for working with {{and }}in a code block? Thank.
source
share