Files
carbon-lang/highlighting
Chandler Carruthandjosh11b e2c5a7ef68 [highlightjs] Add support for var and let. (#1366)
This required reworking how `=` and `;` were handled as well as more
general surgery on patterns.

This looks for initializers at the top level of parameters and at the
end of `var` or `let` declarations. It supports fancy nested `var`
patterns within `let` declarations, etc.

Co-authored-by: josh11b <josh11b@users.noreply.github.com>
2022-07-09 19:40:09 -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.