LibreChat

Syntax Highlighting

All about syntax highlighting

This documentation uses Shiki for syntax highlighting at build time.

Basic Usage

Add code blocks using triple backticks with a language identifier:

```js
console.log('hello, world')
```

Renders as:

console.log('hello, world')

Supported Languages

All languages supported by Shiki are available. Common ones include:

  • js / javascript
  • ts / typescript
  • jsx / tsx
  • bash / sh
  • json
  • yaml
  • python
  • go
  • rust
  • css
  • html
  • markdown / md
  • sql
  • dockerfile

Filenames

You can add a filename to code blocks:

```js filename="example.js"
console.log('hello')
```

Line Highlighting

Highlight specific lines:

```js {1,3-4}
import React from 'react'
 
function Hello() {
  return <div>Hello</div>
}
```

How is this guide?