Skip to content

Line Numbers ​

You can enable line numbering for all code blocks across the slides by setting lineNumbers: true in the headmatter, or enable each code block individually by setting lines: true.

You can also set the starting line for each code block and highlight the lines accordingly via {startLine: number}, which defaults to 1.

md
```ts {6,7}{lines:true,startLine:5}
function add(
  a: Ref<number> | number,
  b: Ref<number> | number
) {
  return computed(() => unref(a) + unref(b))
}
```

Note that you can use {*} as a placeholder of ✨ Line Highlighting:

md
```ts {*}{lines:true,startLine:5}
// ...
```

Released under the MIT License.