NNuartz

Syntax Highlighting

Updated 2026-03-191 min read

nuartz uses rehype-pretty-code (powered by Shiki) for syntax highlighting. This gives you accurate, VS Code-quality highlighting with zero runtime JavaScript.

See features/syntax-highlighting for usage examples.

Themes

The current theme is set in packages/nuartz/src/markdown.ts:

[rehypePrettyCode, {
  theme: {
    light: "github-light",
    dark: "github-dark",
  },
  keepBackground: false,
}]

You can replace "github-light" / "github-dark" with any Shiki bundled theme. Setting keepBackground: true uses the theme's own background colour instead of your site's --background variable.

Line Highlighting

Annotate specific lines in fenced code blocks:

```ts {2,4-6}
const a = 1    // plain
const b = 2    // highlighted
const c = 3    // plain
const d = 4    // highlighted
const e = 5    // highlighted
const f = 6    // highlighted
```

Line Numbers

Add showLineNumbers to enable line numbers:

```ts showLineNumbers
const x = 1
const y = 2
```

Titles

Add a title attribute to label the code block:

```ts title="src/index.ts"
export default {}
```

Source

Linked from (8)