Syntax Highlighting Libraries
February 11, 2026 ยท View on GitHub
We have Bicep support for a number of different highlighting libraries available. This document covers what is currently available.
Textmate
Bicep has a Textmate grammar available at bicep.tmlanguage.
Known uses
- Bicep VSCode extension: Used as a fallback grammar for when semantic token colorization is not ready, or is disabled. This is configured here.
- Bicep Visual Studio extension: Used as a fallback grammar for when the Bicep Visual Studio extension is not installed or when semantic token colorization is not ready.
- GitHub Linguist: Used to provide colorization for
.bicepfiles and Markdown snippets posted on GitHub with```bicepcode blocks. The Bicep repo is configured as a git submodule, so changes to the.tmlanguagefile in this repo should be automatically picked up when a new release of Linguist is deployed.
Notes
To recompile it, run:
cd src/textmate
npm ci
npm run build
To run tests:
cd src/textmate
npm ci
npm test
Previewing baselines (launch an HTTP server, which can be opened in a browser to view the various HTML files):
npx http-server ./src/textmate/test/baselines
Highlight.js
Bicep has a highlight.js plugin available at bicep.min.js. The source is available at bicep.ts.
Usage (HTML)
- Use bicep.min.js in a
<script>tag. - Use 'bicep' as the highlight.js language name.
- See index.html for a usage example.
Usage (JS)
- Copy bicep.es.min.js into your repo.
- Example usage:
import hljs from 'highlight.js'; import bicep from './bicep.es.min'; hljs.registerLanguage('bicep', bicep);
Known uses
- MS Docs: It's used to provide colorization for Bicep samples in MS Docs.
Notes
To build it, run:
cd src/highlightjs
npm ci
npm run build
To run tests:
cd src/highlightjs
npm ci
npm test
Previewing baselines (launch an HTTP server, which can be opened in a browser to view the various HTML files):
npx http-server ./src/highlightjs/test/baselines
Monarch
Bicep has a Monarch plugin available at bicep.ts.
Known uses
-
Monaco: Bundled with Monaco - contributed here.
-
Azure DevOps: Used to provide colorization for Bicep samples in Azure DevOps.
Notes
To build it, run:
cd src/monarch
npm ci
npm run build
To run tests:
cd src/monarch
npm ci
npm test
Previewing baselines (launch an HTTP server, which can be opened in a browser to view the various HTML files):
npx http-server ./src/monarch/test/baselines
Prism.js
Bicep has a community-contributed Prism.JS highlighter available here.
Notepad++
A community-contributed User Defined Language (UDL) file for Bicep syntax highlighting in Notepad++ is available here.