Back to Zulip

CodeBlocksExamples

starlight_help/src/content/include/_CodeBlocksExamples.mdx

12.0549 B
Original Source

import ZulipTip from "../../components/ZulipTip.astro";

What you type

Inline code span: `let x = 5`

Code block:
```
def f(x):
   return x+1
```

Syntax highlighting:
```python
def fib(n):
    # TODO: base case
    return fib(n-1) + fib(n-2)
```
<ZulipTip> You can also use `~~~` to start code blocks, or just indent the code 4 or more spaces. </ZulipTip>

What it looks like

A widget in the top right corner of code blocks allows you to easily copy code to your clipboard.