Skip to content

Build your personal knowledge base with Trilium Notes

feat(highlight): add gdscript

Elian Doraneb77a880dcc0
diff --git a/docs/Release Notes/Release Notes/v0.94.0.md b/docs/Release Notes/Release Notes/v0.94.0.md
index 424423effd..a1770bf4ec 100644
--- a/docs/Release Notes/Release Notes/v0.94.0.md
+++ b/docs/Release Notes/Release Notes/v0.94.0.md
@@ -32,7 +32,7 @@
* [Make it show which node triggered the event when right-clicking on tree](https://github.com/TriliumNext/Notes/pull/1861) by @SiriusXT
* [Only expand/collapse the left pane of the focused window](https://github.com/TriliumNext/Notes/pull/1905) by @SiriusXT
* Code notes:
- * Added the GDScript (Godot) language.
+ * Added the GDScript (Godot) language for both code notes and code blocks in text notes.
* Added the Nix language (and also in code blocks for text notes).
* Added an indentation marker.
* Note: syntax highlighting for some languages (mostly HTML-template languages such as EJS, JSP) is no longer supported due to lack of upstream support. If this is a problem, feel free to report an issue and we can see what can be done about it.
diff --git a/packages/highlightjs/package.json b/packages/highlightjs/package.json
index cc52b96a3a..e5b0a3c07d 100644
--- a/packages/highlightjs/package.json
+++ b/packages/highlightjs/package.json
@@ -19,6 +19,7 @@
"name": "highlightjs"
},
"dependencies": {
+ "@exercism/highlightjs-gdscript": "0.0.1",
"@triliumnext/commons": "workspace:*",
"highlight.js": "11.11.1"
}
diff --git a/packages/highlightjs/src/syntax_highlighting.ts b/packages/highlightjs/src/syntax_highlighting.ts
index 62b14ea42b..0c38758776 100644
--- a/packages/highlightjs/src/syntax_highlighting.ts
+++ b/packages/highlightjs/src/syntax_highlighting.ts
@@ -74,7 +74,7 @@ const byMimeType: MimeRecord = {
"text/x-fortran": () => import("highlight.js/lib/languages/fortran"),
"text/x-fsharp": () => import("highlight.js/lib/languages/fsharp"),
"text/x-gas": null,
- "text/x-gdscript": null,
+ "text/x-gdscript": () => import("@exercism/highlightjs-gdscript"),
"text/x-gfm": () => import("highlight.js/lib/languages/markdown"),
"text/x-go": () => import("highlight.js/lib/languages/go"),
"text/x-groovy": () => import("highlight.js/lib/languages/groovy"),
diff --git a/packages/highlightjs/src/types.d.ts b/packages/highlightjs/src/types.d.ts
new file mode 100644
index 0000000000..ae56ed768d
--- /dev/null
+++ b/packages/highlightjs/src/types.d.ts
@@ -0,0 +1,5 @@
+declare module '@exercism/highlightjs-gdscript' {
+ import { LanguageFn } from "highlight.js";
+ const defineLanguage: LanguageFn;
+ export default defineLanguage;
+}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index b9251fd8f7..be2e6135d2 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -308,7 +308,7 @@ importers:
version: 19.1.5(@types/[email protected])
copy-webpack-plugin:
specifier: 13.0.0
happy-dom:
specifier: 17.4.7
version: 17.4.7
@@ -391,7 +391,7 @@ importers:
version: 1.0.2
copy-webpack-plugin:
specifier: 13.0.0
electron:
specifier: 36.2.1
version: 36.2.1
@@ -444,7 +444,7 @@ importers:
version: 11.0.4
copy-webpack-plugin:
specifier: 13.0.0
electron:
specifier: 36.2.1
version: 36.2.1
@@ -613,7 +613,7 @@ importers:
version: 1.4.7
copy-webpack-plugin:
specifier: 13.0.0
csrf-csrf:
specifier: 3.2.2
version: 3.2.2
@@ -781,7 +781,7 @@ importers:
version: 1.0.1
webpack:
specifier: 5.99.8
ws:
specifier: 8.18.2
@@ -833,7 +833,7 @@ importers:
version: 4.1.0
'@ckeditor/ckeditor5-package-tools':
specifier: ^3.0.1
'@typescript-eslint/eslint-plugin':
specifier: ~8.32.0
@@ -893,7 +893,7 @@ importers:
version: 4.1.0
'@ckeditor/ckeditor5-package-tools':
specifier: ^3.0.1
'@typescript-eslint/eslint-plugin':
specifier: ~8.32.0
@@ -953,7 +953,7 @@ importers:
version: 4.1.0
'@ckeditor/ckeditor5-package-tools':
specifier: ^3.0.1
'@typescript-eslint/eslint-plugin':
specifier: ~8.32.0
@@ -1014,13 +1014,13 @@ importers:
'@ckeditor/ckeditor5-dev-utils':
specifier: 43.0.1
'@ckeditor/ckeditor5-inspector':
specifier: '>=4.1.0'
version: 4.1.0
'@ckeditor/ckeditor5-package-tools':
specifier: ^3.0.1
'@typescript-eslint/eslint-plugin':
specifier: ~8.32.0
@@ -1087,7 +1087,7 @@ importers:
version: 4.1.0
'@ckeditor/ckeditor5-package-tools':
specifier: ^3.0.1
'@typescript-eslint/eslint-plugin':
specifier: ~8.32.0
@@ -1283,6 +1283,9 @@ importers:
packages/highlightjs:
dependencies:
+ '@exercism/highlightjs-gdscript':
+ specifier: 0.0.1
+ version: 0.0.1
'@triliumnext/commons':
specifier: workspace:*
version: link:../commons
@@ -3133,6 +3136,9 @@ packages:
resolution: {integrity: sha512-nULYsQxkWHnbmHvcs+efMkJ4/9TtvNyFeLyHdeGxW0zHs6P+jYVqcRff9A6Vq9w9JXeDRnRh2VKvTtS19GW2qA==}
engines: {node: '>=10'}
+ '@exercism/[email protected]':
+ resolution: {integrity: sha512-LiCFDhXCr3iIEGESHEsSCpCI7qNa2suHcrBWeOYSEtEwCXc+IQpEh5i4K8qPcOMJB9ckVOgLgbSNML8TyvPCVg==}
+
'@file-type/[email protected]':
resolution: {integrity: sha512-pGRmkHf+NofNy/52r06HOTsEwdNnBsFEhN6U95s33P+ezuoxZEyBTV9lOB1/Zr0So6/9vDVfWZXLpgd0fy8cOQ==}
@@ -15302,11 +15308,11 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
'@babel/parser': 7.27.0
'@babel/traverse': 7.27.0
chalk: 5.4.1
fs-extra: 11.3.0
glob: 10.4.5
@@ -15324,58 +15330,58 @@ snapshots:
- uglify-js
- webpack
dependencies:
'@ckeditor/ckeditor5-dev-translations': 43.0.1
chalk: 3.0.0
cli-cursor: 3.1.0
cli-spinners: 2.9.2
cssnano: 6.1.2([email protected])
del: 5.1.0
fs-extra: 11.3.0
is-interactive: 1.0.0
javascript-stringify: 1.6.0
mocha: 7.2.0
postcss: 8.5.3
postcss-import: 14.1.0([email protected])
postcss-mixins: 9.0.4([email protected])
postcss-nesting: 13.0.1([email protected])
shelljs: 0.8.5
through2: 3.0.2
transitivePeerDependencies:
- bluebird
- supports-color
- webpack
dependencies:
chalk: 5.4.1
cli-cursor: 5.0.0
cli-spinners: 3.2.0
cssnano: 7.0.6([email protected])
fs-extra: 11.3.0
is-interactive: 2.0.0
mocha: 10.8.2
postcss: 8.5.3
postcss-import: 16.1.0([email protected])
postcss-mixins: 11.0.3([email protected])
postcss-nesting: 13.0.1([email protected])
shelljs: 0.8.5
through2: 4.0.2
transitivePeerDependencies:
- '@rspack/core'
@@ -15656,29 +15662,29 @@ snapshots:
'@ckeditor/ckeditor5-utils': 45.1.0
ckeditor5: 45.1.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
dependencies:
buffer: 6.0.3
chalk: 5.4.1
fs-extra: 11.3.0
glob: 7.2.3
minimist: 1.2.8
postcss: 8.5.3
process: 0.11.10
stylelint: 16.19.1([email protected])
stylelint-config-ckeditor5: 2.0.1([email protected]([email protected]))
typescript: 5.0.4
transitivePeerDependencies:
- '@rspack/core'
- '@swc/core'
@@ -16854,6 +16860,8 @@ snapshots:
'@excalidraw/[email protected]': {}
+ '@exercism/[email protected]': {}
+
'@file-type/[email protected]':
dependencies:
sax: 1.4.1
@@ -21636,14 +21644,14 @@ snapshots:
serialize-javascript: 6.0.2
dependencies:
glob-parent: 6.0.2
normalize-path: 3.0.0
schema-utils: 4.3.2
serialize-javascript: 6.0.2
tinyglobby: 0.2.13
dependencies:
@@ -21751,7 +21759,7 @@ snapshots:
dependencies:
icss-utils: 5.1.0([email protected])
loader-utils: 2.0.4
@@ -21763,7 +21771,7 @@ snapshots:
postcss-value-parser: 4.2.0
schema-utils: 3.3.0
semver: 7.7.1
dependencies:
@@ -21778,7 +21786,7 @@ snapshots:
optionalDependencies:
dependencies:
icss-utils: 5.1.0([email protected])
postcss: 8.5.3
@@ -21789,7 +21797,7 @@ snapshots:
postcss-value-parser: 4.2.0
semver: 7.7.2
optionalDependencies:
dependencies:
@@ -22831,20 +22839,20 @@ snapshots:
dependencies:
esbuild: 0.17.19
get-tsconfig: 4.10.0
loader-utils: 2.0.4
webpack-sources: 1.4.3
dependencies:
esbuild: 0.25.3
get-tsconfig: 4.10.0
loader-utils: 2.0.4
webpack-sources: 1.4.3
@@ -25801,10 +25809,10 @@ snapshots:
schema-utils: 4.3.2
dependencies:
schema-utils: 4.3.2
@@ -26903,7 +26911,7 @@ snapshots:
camelcase-css: 2.0.1
postcss: 8.5.3
dependencies:
cosmiconfig: 7.1.0
klona: 2.0.6
@@ -26911,7 +26919,7 @@ snapshots:
postcss: 8.5.3
schema-utils: 3.3.0
semver: 7.7.1
dependencies:
@@ -26921,14 +26929,14 @@ snapshots:
semver: 7.7.1
dependencies:
cosmiconfig: 9.0.0([email protected])
jiti: 1.21.7
postcss: 8.5.3
semver: 7.7.2
optionalDependencies:
transitivePeerDependencies:
- typescript
@@ -27502,11 +27510,11 @@ snapshots:
dependencies:
loader-utils: 2.0.4
schema-utils: 3.3.0
dependencies:
@@ -28678,19 +28686,19 @@ snapshots:
'@tokenizer/token': 0.3.0
peek-readable: 5.4.2
dependencies:
loader-utils: 2.0.4
schema-utils: 3.3.0
dependencies:
dependencies:
@@ -29051,7 +29059,7 @@ snapshots:
rimraf: 2.6.3
optional: true
dependencies:
cacache: 15.3.0
find-cache-dir: 3.3.2
@@ -29061,7 +29069,7 @@ snapshots:
serialize-javascript: 5.0.1
source-map: 0.6.1
terser: 5.39.0
webpack-sources: 1.4.3
transitivePeerDependencies:
- bluebird
@@ -29078,14 +29086,14 @@ snapshots:
'@swc/core': 1.11.24(@swc/[email protected])
esbuild: 0.25.4
dependencies:
'@jridgewell/trace-mapping': 0.3.25
jest-worker: 27.5.1
schema-utils: 4.3.2
serialize-javascript: 6.0.2
terser: 5.39.0
optionalDependencies:
'@swc/core': 1.11.24(@swc/[email protected])
esbuild: 0.25.4
@@ -29243,7 +29251,7 @@ snapshots:
dependencies:
chalk: 4.1.2
enhanced-resolve: 5.18.1
@@ -29251,7 +29259,7 @@ snapshots:
semver: 7.7.1
source-map: 0.7.4
typescript: 5.0.4
dependencies:
@@ -29945,7 +29953,7 @@ snapshots:
optionalDependencies:
dependencies:
colorette: 2.0.20
memfs: 4.17.0
@@ -29954,9 +29962,9 @@ snapshots:
range-parser: 1.2.1
schema-utils: 4.3.2
optionalDependencies:
dependencies:
'@types/bonjour': 3.5.13
'@types/connect-history-api-fallback': 1.5.4
@@ -29984,10 +29992,10 @@ snapshots:
serve-index: 1.9.1
sockjs: 0.3.24
spdy: 4.0.2
- webpack-dev-middleware: 7.4.2([email protected])
optionalDependencies:
webpack-cli: 6.0.1([email protected])
transitivePeerDependencies:
- bufferutil
@@ -29995,7 +30003,7 @@ snapshots:
- supports-color
- utf-8-validate
dependencies:
'@types/bonjour': 3.5.13
'@types/connect-history-api-fallback': 1.5.4
@@ -30023,10 +30031,10 @@ snapshots:
serve-index: 1.9.1
sockjs: 0.3.24
spdy: 4.0.2
+ webpack-dev-middleware: 7.4.2([email protected])
optionalDependencies:
webpack-cli: 6.0.1([email protected])
transitivePeerDependencies:
- bufferutil
@@ -30091,7 +30099,7 @@ snapshots:
- esbuild
- uglify-js
dependencies:
'@types/eslint-scope': 3.7.7
'@types/estree': 1.0.7
@@ -30114,7 +30122,7 @@ snapshots:
neo-async: 2.6.2
schema-utils: 4.3.2
tapable: 2.2.1
watchpack: 2.4.2
webpack-sources: 3.2.3
optionalDependencies: