read this blog post from Charles T. Gray http://cantabile.rbind.io/2018/06/26/quack-quack-environment/ and/or view this twitter thread https://twitter.com/cantabile/status/1011469151733288962
Clone or download this project to your machine.
- Edit
quack_quack.rmd
- create new code chunks for quack_quack code, insert a new chunk and replace
{r}
with{quack_quack}
- in quack_quack chunks, the code won't run, this is a GOOD THING. Knitr will warn but will continue processing.
- any dataset represented like
some_dataset
and references toquack_quack
andcolumn_name
will be highlighted in the knitted html output - regular
{r}
chunks will be processed. - save the .rmd and knit to html
- more quack_quack keywords can be added by editing
scripts/prism.js
and adding new tokens with'token_name': regex for keyword(s)
- search for
quack_quack
inscripts/prism.js
to see examples and to be in the correct spot to add new tokens - to change the css open
themes/prism.css
and search for.token.quack_quack
for an example
View a preview of the knitted htlm file here : https://adam-gruer.github.io/quack_quack/quack_quack.html
The project involves some R Markdown chunk tricks and a customized version of the Prism.js syntax highlighter for R.
Help wanted : customizing RStudio syntax highlighting to display the quack_quack syntax natively in .Rmd files in the RStudio editor