From d762312ba752dc984efd66841b81b1e6d9240e09 Mon Sep 17 00:00:00 2001 From: Nicolae Stroncea Date: Fri, 23 Jul 2021 23:55:10 -0400 Subject: [PATCH 1/2] added graphql language --- client/sidebar.js | 10 ++++++++++ package.json | 1 + 2 files changed, 11 insertions(+) diff --git a/client/sidebar.js b/client/sidebar.js index 1b09085..cb00400 100644 --- a/client/sidebar.js +++ b/client/sidebar.js @@ -19,6 +19,16 @@ const ids = { error: '#error' }; +/** + * Define languages that are not included in highlight.js by default + */ + function defineOtherLanguages() { + const graphql = require("highlightjs-graphql") + graphql(hljs) +} + +defineOtherLanguages(); + /** * On document load, try to load languages and themes, try to load the user's * preferences if previously set, and assign click handlers to each button. diff --git a/package.json b/package.json index bc936b7..75c3ec5 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "browserify": "16.5.0", "clean-css-cli": "4.3.0", "highlight.js": "9.16.2", + "highlightjs-graphql": "^1.0.2", "jquery": "3.4.1", "juice": "5.2.0", "uglify-es": "3.3.9", From b6667c701ce308f7384723636e025eb5a08608aa Mon Sep 17 00:00:00 2001 From: Alex Forsythe Date: Wed, 3 Aug 2022 10:13:50 -0700 Subject: [PATCH 2/2] Rename defineOtherLanguages and fix formatting Co-authored-by: Alexander Momchilov --- client/sidebar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/sidebar.js b/client/sidebar.js index cb00400..40d0211 100644 --- a/client/sidebar.js +++ b/client/sidebar.js @@ -22,7 +22,7 @@ const ids = { /** * Define languages that are not included in highlight.js by default */ - function defineOtherLanguages() { +function defineThirdPartyGrammars() { const graphql = require("highlightjs-graphql") graphql(hljs) }