> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify-han-update-changelogs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Code Blocks

> Display code with optional syntax highlighting

<RequestExample>
  ````md Code Block Example
  ```javascript Code Block Example
  const hello = "world";
  ```
  ````
</RequestExample>

## Basic Code Block

Use [fenced code blocks](https://www.markdownguide.org/extended-syntax/#fenced-code-blocks) by enclosing code in three backticks.

```
helloWorld();
```

````md
```
helloWorld();
```
````

## Syntax Highlighting

Put the name of your programming language after the three backticks to get syntax highlighting.

We use [Prism](https://prismjs.com/#supported-languages) for syntax highlighting. [Test Drive Prism](https://prismjs.com/test.html#language=markup) lists all the languages supported.

```java
class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}
```

````md
```java
class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}
```
````

## Names

You can add more text after the programming language to set the name of your code example. The text can be anything as long as its all in one line.

```javascript Code Block Example
const hello = "world";
```

````md Code Block Example
```javascript Code Block Example
const hello = "world";
```
````

## Line Highlighting

You can highlight specific lines in your code blocks by adding a special comment after the language identifier. Use curly braces `{}` and specify line numbers or ranges separated by commas.

```javascript Line Highlighting Example {1,3-5}
const greeting = "Hello, World!";
function sayHello() {
  console.log(greeting);
}
sayHello();
```

````md
```javascript Line Highlighting Example {1,3-5}
const greeting = "Hello, World!";
function sayHello() {
  console.log(greeting);
}
sayHello();
```
````

## Code Groups

Want to display multiple code examples in one code box? Check out the Code Group docs:

<Card title="Code Group" href="/content/components/code-groups" icon="columns-3">
  Read the reference for the Code Group component
</Card>
