mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-23 00:34:48 -06:00
fa9ae9437c
The gitbook install has been incredibly flaky due to it's dependency on npm. This commit simply vendors the node_modules so that each time we build the site the process doesn't have to re-run gitbook install. Signed-off-by: Torin Sandall <torinsandall@gmail.com>
66 lines
1.3 KiB
JavaScript
66 lines
1.3 KiB
JavaScript
module.exports = function(hljs) {
|
|
var IDENTIFIER = '[a-zA-Z-_][^\\n{]+\\{';
|
|
|
|
var PROPERTY = {
|
|
className: 'attribute',
|
|
begin: /[a-zA-Z-_]+/, end: /\s*:/, excludeEnd: true,
|
|
starts: {
|
|
end: ';',
|
|
relevance: 0,
|
|
contains: [
|
|
{
|
|
className: 'variable',
|
|
begin: /\.[a-zA-Z-_]+/
|
|
},
|
|
{
|
|
className: 'keyword',
|
|
begin: /\(optional\)/
|
|
}
|
|
]
|
|
}
|
|
};
|
|
|
|
return {
|
|
aliases: ['graph', 'instances'],
|
|
case_insensitive: true,
|
|
keywords: 'import',
|
|
contains: [
|
|
// Facet sections
|
|
{
|
|
begin: '^facet ' + IDENTIFIER,
|
|
end: '}',
|
|
keywords: 'facet',
|
|
contains: [
|
|
PROPERTY,
|
|
hljs.HASH_COMMENT_MODE
|
|
]
|
|
},
|
|
|
|
// Instance sections
|
|
{
|
|
begin: '^\\s*instance of ' + IDENTIFIER,
|
|
end: '}',
|
|
keywords: 'name count channels instance-data instance-state instance of',
|
|
illegal: /\S/,
|
|
contains: [
|
|
'self',
|
|
PROPERTY,
|
|
hljs.HASH_COMMENT_MODE
|
|
]
|
|
},
|
|
|
|
// Component sections
|
|
{
|
|
begin: '^' + IDENTIFIER,
|
|
end: '}',
|
|
contains: [
|
|
PROPERTY,
|
|
hljs.HASH_COMMENT_MODE
|
|
]
|
|
},
|
|
|
|
// Comments
|
|
hljs.HASH_COMMENT_MODE
|
|
]
|
|
};
|
|
}; |