Files
onlyoffice.github.io/sdkjs-plugins/content/highlightcode

Overview

Highlight syntax of the code selecting the necessary language, style, and background color.

The plugin uses the highlight.js engine, prettier library, [prettier-plugin-php] (https://github.com/prettier/plugin-php) plugin, xml-formatter.js library and js-beautify.js library.

It is installed by default in cloud, self-hosted and desktop version of ONLYOFFICE editors.

Supported languages and styles

Supported languages: apache, bash, shell, matlab, erlang, javascript, profile, ruby, prolong, swift, sql, java, http, fortran, perl, xml, cpp, json, cs, nginx, basic, markdown, css, python, objectivec, php, delphi.

Supported styles: Googlecode, GitHub, GitHub Gist, Android Studio, Visual Studio, Visual Studio 2015, Idea, Qtcreator Dark, Qtcreator Light, XCode, Fortran, Foundation, XML 1, XML 2.

How to use

  1. Find the plugin in the Plugins tab.
  2. Insert your code.
  3. Set the language you use. It will be defined automatically, but you can also change it manually.
  4. Choose style/background color and press OK to insert your code into the document.

If you need more information about how to use or write your own plugin, please see this https://api.onlyoffice.com/docs/plugin-and-macros/get-started/overview/