Files
carbon-lang/highlighting
Chandler Carruth b4d4f5423d [highlightjs] Add virtual method keywords. (#1377)
This also tidies up the keyword detection for classes a bit so we won't
highlight bizarre things like `allyourbase class`, or `base classy` etc.
2022-07-10 00:05:51 -07:00
..

Highlighting utilities

This directory collects syntax highlighting utilities for use with Carbon code.

highlight.js

This JavaScript syntax highlighting system is used on webpages or in presentation software like reveal.js.

The code is in [highlightjs_carbon_lang.js], and you can use it by registering it after you load highlight.js:

<script type="module">
    import Carbon from './highlightjs_carbon_lang.js';
    hljs.registerLanguage('Carbon', Carbon);
    hljs.highlightAll();
</script>

See [highlightjs_example.html] for a more complete example.

It includes many Carbon-specific markup indicators that may be useful to customize display or highlighting of Carbon code.