> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.knapsack.cloud/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.knapsack.cloud/_mcp/server.

# Code Snippet Block

## Overview

The code snippet block provides syntax highlighting for a variety of programming languages

![code-snippet-block.png](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/knapsack-docs.docs.buildwithfern.com/b5b3d3ac721afc02d4644bc80569060805eb155e55362d72c7077cb6488eee87/docs/assets/images/5dc0f73e-code-snippet-blockpng.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260724%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260724T211036Z&X-Amz-Expires=604800&X-Amz-Signature=5fd1fd362ad408c067c110e41ef3dec241f05767c48e0ecd87da15b5296904de&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

## Language Selector

While in edit mode a dropdown menu is available to select the desired language that you want to represent in the code snippet. You can also select `Auto` which allows the code snippet to infer the language from the written code.

![code-snippet-block.png](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/knapsack-docs.docs.buildwithfern.com/d243ecf882feb97014ba9009003e176514ab9d6bef5b565a3ad4d78c645bf1ed/docs/assets/images/97c95f48-code-snippet-blockpng.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260724%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260724T211036Z&X-Amz-Expires=604800&X-Amz-Signature=a82e40f0ea312f8f61105e9f29736e9aabee0f7a694f0b1d027360fc8cae53c5&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

## Copy to Clipboard

Using the clipboard icon in the top right of the code snippet block, users can copy the code to be shared or pasted into their editor.