Skip to content

pseudo code with syntax highlighting from R Markdown and Prism.js

License

Notifications You must be signed in to change notification settings

adam-gruer/quack_quack

Repository files navigation

quack_quack

Count Duckula

pseudo (quack_quack) code with syntax highlighting from R Markdown and Prism.js

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

How to use.

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 to quack_quack and column_name will be highlighted in the knitted html output
  • regular {r} chunks will be processed.
  • save the .rmd and knit to html

Extending

  • 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 in scripts/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

About

pseudo code with syntax highlighting from R Markdown and Prism.js

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published