# Code

Highlighted code with titles and line numbers, code groups and diagrams.

```bash
npm install
```

{% code title="docsheaf.config.ts" lineNumbers="true" %}
```ts
export default {
  site: 'docsheaf',
  sections: ['docs', 'developers', 'changelog'],
};
```
{% endcode %}

{% code title="Long lines wrap" overflow="wrap" %}
```text
This block wraps long lines instead of scrolling them sideways, which suits prose-like output such as logs and error messages that run on and on.
```
{% endcode %}

## Code group

One sample in several languages, as tabs:

{% code-group %}
{% code title="curl" %}
```bash
curl https://petstore3.swagger.io/api/v3/store/inventory
```
{% endcode %}

{% code title="JavaScript" %}
```js
const res = await fetch('https://petstore3.swagger.io/api/v3/store/inventory');
console.log(await res.json());
```
{% endcode %}

{% code title="Python" %}
```python
import requests
print(requests.get("https://petstore3.swagger.io/api/v3/store/inventory").json())
```
{% endcode %}
{% endcode-group %}

## Diagrams

A `mermaid` code block is drawn as a diagram:

```mermaid
flowchart LR
  Draft --> Review --> Publish
```
