Skip to content

Rmd fenced block syntax highlighting for julia, python, etc#460

Merged
renkun-ken merged 1 commit intoREditorSupport:masterfrom
kar9222:rmd-fenced-block
Nov 23, 2020
Merged

Rmd fenced block syntax highlighting for julia, python, etc#460
renkun-ken merged 1 commit intoREditorSupport:masterfrom
kar9222:rmd-fenced-block

Conversation

@kar9222
Copy link
Copy Markdown
Contributor

@kar9222 kar9222 commented Nov 23, 2020

What problem did you solve?
Add Rmd fenced block syntax highlighting for common languages in Rmd

  • Julia
  • Stan
  • Python
  • SQL
  • CSS
  • SCSS
  • JS

Although there are a total of 42 supported languages, I think we can keep VSCode-R lean by just supporting additional languages above, which should cover almost all use cases. New language can be added upon user request.

❯ names(knitr::knit_engines$get())

 [1] "awk"       "bash"      "coffee"    "gawk"      "groovy"
 [6] "haskell"   "lein"      "mysql"     "node"      "octave"
[11] "perl"      "psql"      "Rscript"   "ruby"      "sas"
[16] "scala"     "sed"       "sh"        "stata"     "zsh"
[21] "highlight" "Rcpp"      "tikz"      "dot"       "c"
[26] "cc"        "fortran"   "fortran95" "asy"       "cat"
[31] "asis"      "stan"      "block"     "block2"    "js"
[36] "css"       "sql"       "go"        "python"    "julia"
[41] "sass"      "scss"

Before PR

1

After PR

(Kindly ignore the minor different colors of my Julia's starting code block because I customize it in my theme extension. They all should have the same colors on your machine e.g. white color as shown here)

2

Copy link
Copy Markdown
Member

@renkun-ken renkun-ken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Tested on macOS and it works nicely. Thanks!

@renkun-ken renkun-ken merged commit bf61629 into REditorSupport:master Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants