Skip to content

Starlight

To add syntax highlighting for a language that is not supported by Shiki by default, follow these instructions.

  • Find a suitable textmate json object file, such as this.
    • save the file to e.g. src/syntax/odin.tmLanguage.json
  • Edit astro.config.js
    • Add:
integrations: [starlight({
title: 'jmn docs',
expressiveCode: {
plugins: [pluginLineNumbers()],
shiki: {
langs: [
JSON.parse(fs.readFileSync('./src/syntax/odin.tmLanguage.json', 'utf-8'))
]
}
},
...

package main
import "core:fmt"
main :: proc() {
fmt.println("Hellope, World!");
}