Open gadenbuie opened 4 years ago
In R Markdown inline code is indistinguishable from a standard markdown code chunk. Both are classed .ace_support.ace_function
.
Note that the `echo = FALSE` parameter was added to the code chunk...
<div class="ace_line" style="height:19px">
Note that the
<span class="ace_support ace_function">`</span>
<span class="ace_support ace_function">echo = FALSE</span>
<span class="ace_support ace_function">`</span>
parameter was added to the code chunk...
</div>
```r
library(ggplot2)
```html
<div class="ace_line_group" style="height:19px">
<div class="ace_line" style="height:19px">
<span class="ace_support ace_function">```r</span>
</div>
</div>
<div class="ace_line_group" style="height:19px">
<div class="ace_line" style="height:19px">
<span class="ace_support ace_function">library(ggplot2)</span>
</div>
</div>
<div class="ace_line_group" style="height:19px">
<div class="ace_line" style="height:19px">
<span class="ace_support ace_function">```</span>
</div>
</div>
I would love to be able to style a variables when it's being assigned, i.e. add
in the example below.
I would also like to be able to distinguish between function formals and variables in use, e.g. to differentiate between x
and y
in the add
function definition, the x
and y
in the function call add(x = 1, y = 2)
, and the x
and y
in use as variables inside the add()
definition.
add <- function(x, y) {
x + y
}
add(x = 1, y = 2)
<div class="ace_line" style="height:19px">
<span class="ace_identifier">add</span> <!-- Variable in assignment -->
<span class="ace_keyword ace_operator"><-</span>
<span class="ace_keyword">function</span>
<span class="ace_paren ace_keyword ace_operator">(</span>
<span class="ace_identifier">x</span> <!-- function formal -->
<span class="ace_punctuation ace_keyword ace_operator">,</span>
<span class="ace_identifier">y</span>
<span class="ace_paren ace_keyword ace_operator">)</span>
<span class="ace_paren ace_keyword ace_operator">{</span>
</div>
<div class="ace_line" style="height:19px">
<span class="ace_identifier">x</span> <!-- variable in use -->
<span class="ace_keyword ace_operator">+</span>
<span class="ace_identifier">y</span>
</div>
<div class="ace_line" style="height:19px">
<span class="ace_paren ace_keyword ace_operator">}</span>
</div>
<div class="ace_line" style="height:19px">
<span class="ace_identifier ace_support ace_function">add</span>
<span class="ace_paren ace_keyword ace_operator">(</span>
<span class="ace_identifier">x</span> <!-- function argument -->
<span class="ace_keyword ace_operator">=</span>
<span class="ace_constant ace_numeric">1</span>
<span class="ace_punctuation ace_keyword ace_operator">,</span>
<span class="ace_identifier">y</span>
<span class="ace_keyword ace_operator">=</span>
<span class="ace_constant ace_numeric">2</span>
<span class="ace_paren ace_keyword ace_operator">)</span>
</div>
A running list of a few things I wish were easier to theme, as I encounter them.