# Fenced code
> Regular code fences: language detection, copy button, Shiki syntax highlighting.
Source: https://shelldocs.shellui.dev/docs/authoring/fenced-code
Fenced code blocks (` ``` `) are the workhorse of docs authoring. ShellDocs wraps every fence in chrome : a language badge, a copy button, and Shiki-driven syntax highlighting. You don't opt in : any fence with a language tag gets the treatment.
## Basic use
Standard CommonMark : three backticks, a language name, the code, three backticks.
````markdown
```csharp
var pipeline = new MarkdownPipelineBuilder()
.UsePipeTables()
.Build();
```
````
Renders as:
```csharp
var pipeline = new MarkdownPipelineBuilder()
.UsePipeTables()
.Build();
```
## Language detection
The language name after the opening ` ``` ` becomes a `language-` element. `CodeBlockEnhancer` extracts it, renders a badge in the header, and Shiki uses it for highlighting.
Common values: `csharp`, `razor`, `bash`, `json`, `yaml`, `xml`, `html`, `css`, `typescript`, `python`. Any Shiki-supported language works.
## The copy button
Every fence gets a copy button in the top-right. Click copies the raw text : language badge, whitespace, and newlines are preserved exactly as authored. On success it flashes a checkmark for ~1 s. No configuration : it's on by default.
## No-language fences
Fences without a language tag still render : just no badge and no highlighting. Useful for shell prompts or ad-hoc text.
````markdown
```
$ shelldocs init MyDocs
â Wrote 12 change(s):
```
````
Renders as:
```
$ shelldocs init MyDocs
â Wrote 12 change(s):
```
## Indented code
Four-space-indented code blocks still work (CommonMark supports them) but you lose the language badge and the copy button. **Prefer fenced blocks** : they're what all the chrome hooks into.
## Inline code
Backtick-wrapped inline code (`` `like this` ``) is styled but has no copy button or language handling. Use it for identifiers, short snippets, and API references : `