Custom syntax highlighting in quarto doc code chunks

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/RStudio

Our great sponsors
  • Appwrite - The Open Source Firebase alternative introduces iOS support
  • SonarQube - Static code analysis for 29 languages.
  • InfluxDB - Access the most powerful time series database as a service
  • pandoc-goodies

    A tresure-box of resources for pandoc, pp and Texts word processor.

    1) Pandoc uses KDE .theme files (JSON) to map a style (color, face, ...) to the various "roles" a piece of your code can have (keyword, operator, property, ...). Check this to learn more about those theme files. You can use this boilerplate as a base to create your custom theme. Refer to this guide for more details about which keys in the .theme file correspond to which parts of the code.

  • skylighting

    A Haskell syntax highlighting library with tokenizers derived from KDE syntax highlighting descriptions

    2) Pandoc invokes the skylight Haskell library, which uses XML syntax descriptions to define which tokens/pieces of a given language have which "role". Skylight will parse your code and tag each part of it according to those rules. You can edit those XML files (or create new ones). Check this page for a description of how they work. You'll find the existing KDE XML syntax descriptors here.

  • Appwrite

    Appwrite - The Open Source Firebase alternative introduces iOS support. Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!

  • syntax-highlighting

    Syntax highlighting Engine for Structured Text and Code.

    2) Pandoc invokes the skylight Haskell library, which uses XML syntax descriptions to define which tokens/pieces of a given language have which "role". Skylight will parse your code and tag each part of it according to those rules. You can edit those XML files (or create new ones). Check this page for a description of how they work. You'll find the existing KDE XML syntax descriptors here.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts