An open API service indexing awesome lists of open source software.

https://github.com/highlightjs/highlightjs-sentinel

HashiCorp's Sentinel policy-as-code language
https://github.com/highlightjs/highlightjs-sentinel

Last synced: 4 months ago
JSON representation

HashiCorp's Sentinel policy-as-code language

Awesome Lists containing this project

README

        

# `sentinel` - a language definition for highlight.js

This is a [highlight.js](https://highlightjs.org/) language definition for
[Sentinel](https://docs.hashicorp.com/sentinel/), HashiCorp's policy as code
language.

For more about highlight.js, see https://highlightjs.org/

For more about Sentinel, see https://docs.hashicorp.com/sentinel/.

### Usage

Simply include the `highlight.js` script package in your webpage or node app,
load up this module and apply it to `hljs`.

If you're not using a build system and just want to embed this in your webpage:

```html

hljs.registerLanguage('sentinel', hljsDefineSentinel);
hljs.highlightAll();

```

If you're using webpack / rollup / browserify / node:

```javascript
var hljs = require('highlightjs');
var hljsDefineSentinel = require('highlightjs-sentinel');

hljsDefineSentinel(hljs);
hljs.highlightAll();
```

### Advanced

This is a pretty simple package, the only thing you might want to do differently
is name the language something other than `sentinel`. If you want to do this,
simply `import { definer } from 'highlightjs-sentinel';` and use it like:
`hljs.registerLanguage('othername', definer);`.

### Author

Chris Marchesi

Based on the Go highlight.js language definition, by Stephan Kountso
and Evgeny Stepanischev .

### Maintainer

Chris Marchesi