@gaijin/highlightjs-dshl
v1.2.0
Published
highlight.js grammar for DSHL, the shader language of the Dagor Engine
Readme
@gaijin/highlightjs-dshl
A highlight.js 11 grammar for DSHL, the shader language of the
Dagor Engine. It colors the DSHL layer and the HLSL code inside
hlsl blocks. The language name is dshl.
Usage
npm install highlight.js @gaijin/highlightjs-dshlimport hljs from 'highlight.js/lib/core';
import dshl from '@gaijin/highlightjs-dshl';
hljs.registerLanguage('dshl', dshl);
const html = hljs.highlight(code, {language: 'dshl'}).value;In a web page, load dist/dshl.min.js after highlight.js. The script registers the grammar on the global hljs:
<script src="https://cdn.jsdelivr.net/npm/@gaijin/highlightjs-dshl/dist/dshl.min.js"></script>References
- The shader compiler of the Dagor Engine, whose lexer and syntax rules this grammar follows.
dshl.hrc, the Colorer definition that sets the keyword groups and their colors.
License
MIT. See LICENSE.
