Files
directus/app/src/utils/hljs-graphql.ts
Rijk van Zanten df22a58c6a Update in-app docs (#3989)
* Fix root redirect

* Fix html in headings

* Add graphql syntax mode

* Install markdown-it + plugins

* Fix file copying on mac

* Replace md rendering engine

* Fix wrong links in guides

* Scroll to top on every route change

* Update in-app links

* Fix home redirect

* Fix deep-linking paths

* Add to reference

* Fix nested group scoping

* Fix open path reference
2021-02-09 18:31:25 -05:00

46 lines
829 B
TypeScript

import { HASH_COMMENT_MODE, QUOTE_STRING_MODE, NUMBER_MODE } from 'highlight.js';
export default () => ({
aliases: ['gql'],
keywords: {
keyword:
'query mutation subscription|10 type input schema directive interface union scalar fragment|10 enum on ...',
literal: 'true false null',
},
contains: [
HASH_COMMENT_MODE,
QUOTE_STRING_MODE,
NUMBER_MODE,
{
className: 'type',
begin: '[^\\w][A-Z][a-z]',
end: '\\W',
excludeEnd: !0,
},
{
className: 'literal',
begin: '[^\\w][A-Z][A-Z]',
end: '\\W',
excludeEnd: !0,
},
{
className: 'variable',
begin: '\\$',
end: '\\W',
excludeEnd: !0,
},
{
className: 'keyword',
begin: '[.]{2}',
end: '\\.',
},
{
className: 'meta',
begin: '@',
end: '\\W',
excludeEnd: !0,
},
],
illegal: /([;<']|BEGIN)/,
});