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_datasetand references toquack_quackandcolumn_namewill 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.jsand adding new tokens with'token_name': regex for keyword(s) - search for
quack_quackinscripts/prism.jsto see examples and to be in the correct spot to add new tokens - to change the css open
themes/prism.cssand search for.token.quack_quackfor 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
