Skip to content

Commit

Permalink
docs: add highlight.langs
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Feb 6, 2024
1 parent 9ee785d commit 61f6cda
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/content/1.get-started/2.configuration.md
Expand Up @@ -179,7 +179,7 @@ Nuxt Content uses [Shiki](https://github.com/shikijs/shiki) to provide syntax hi
| Option | Type | Description |
| --------- | :------------------------------------------: | :------------------------------------------------------------------------------------------------------------------ |
| `theme` | `ShikiTheme` or `Record<string, ShikiTheme>` | The [color theme](https://github.com/shikijs/shiki/blob/main/docs/themes.md) to use. |
| `preload` | `ShikiLang[]` | The [preloaded languages](https://github.com/shikijs/shiki/blob/main/docs/languages.md) available for highlighting. |
| `langs` | `ShikiLang[]` | The [loaded languages](https://github.com/shikijs/shiki/blob/main/docs/languages.md) available for highlighting. |

- `highlight.theme`

Expand Down Expand Up @@ -209,17 +209,17 @@ export default defineNuxtConfig({
})
```

- `highlight.preload`
- `highlight.langs`

By default, module preloads couple of languages for syntax highlighter: `['diff', 'json', 'js', 'ts', 'css', 'shell', 'html', 'md', 'yaml']`
By default, module loads couple of languages for syntax highlighter: `['json', 'js', 'ts', 'html', 'css', 'vue', 'shell', 'mdc', 'md', 'yaml']`

If you plan to use code samples of other languages, you need to define the language in these options.

```ts
export default defineNuxtConfig({
content: {
highlight: {
preload: [
langs: [
'c',
'cpp',
'java'
Expand All @@ -237,7 +237,7 @@ import { readFileSync } from 'node:fs'
export default defineNuxtConfig({
content: {
highlight: {
preload: [
langs: [
// Read more about Shiki languages: https://shiki.style/guide/load-lang
JSON.parse(
readFileSync('./shiki/languages/gdscript.tmLanguage.json', 'utf-8'),
Expand Down

0 comments on commit 61f6cda

Please sign in to comment.