We have Bicep support for a number of different highlighting libraries available. This document covers what is currently available.
Bicep has a Textmate grammar available at bicep.tmlanguage.
- 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
.bicep
files and Markdown snippets posted on GitHub with```bicep
code blocks. The Bicep repo is configured as a git submodule, so changes to the.tmlanguage
file in this repo should be automatically picked up when a new release of Linguist is deployed.
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
Bicep has a highlight.js plugin available at bicep.min.js. The source is available at bicep.ts.
- Use bicep.min.js in a
<script>
tag. - Use 'bicep' as the highlight.js language name.
- See index.html for a usage example.
- MS Docs: It's used to provide colorization for Bicep samples in MS Docs. This site is using a fork of Highlight.js, so changes to the grammar must be compiled and submitted to the fork repo for integration.
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
Bicep has a Monarch plugin available at bicep.ts.
-
Monaco: Bundled with Monaco - contributed here.
-
Azure DevOps: Used to provide colorization for Bicep samples in Azure DevOps.
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
Bicep has a community-contributed Prism.JS highlighter available here.