File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -317,6 +317,36 @@ export default defineNuxtConfig({
317
317
})
318
318
```
319
319
320
+ If you wish to add highlighting for an unsupported language, you can do so by loading the grammar file for the language.
321
+
322
+ ``` ts
323
+ import { readFileSync } from ' fs'
324
+
325
+ export default defineNuxtConfig ({
326
+ content: {
327
+ highlight: {
328
+ preload: [
329
+ {
330
+ id: ' gdscript' ,
331
+ scopeName: ' source.gdscript' ,
332
+ aliases: [' gdscript' , ' gd' ], // Use to mark code blocks in Markdown
333
+ grammar: JSON .parse (
334
+ readFileSync (
335
+ // Place the language grammar file somewhere in your project
336
+ ' ./shiki/languages/gdscript.tmLanguage.json'
337
+ ).toString ()
338
+ ),
339
+ },
340
+ ],
341
+ },
342
+ },
343
+ })
344
+
345
+ ```
346
+
347
+ Read more about adding languages in the [ Shiki documentation] ( https://github.com/shikijs/shiki/blob/main/docs/languages.md#adding-grammar ) .
348
+
349
+
320
350
## ` yaml `
321
351
322
352
- Type: ` false | Object ` {lang=ts}
You can’t perform that action at this time.
0 commit comments