Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/sorgm/data-architecture-docs/llms.txt

Use this file to discover all available pages before exploring further.

Code blocks are essential for technical documentation. Mintlify provides powerful syntax highlighting and features to make your code examples clear and useful.

Inline code

Use backticks to denote inline code: npm install or const example = true.
Use backticks: `npm install` or `const example = true`

Basic code blocks

Create code blocks with triple backticks and specify the language for syntax highlighting:
function greet(name) {
  console.log(`Hello, ${name}!`);
  return true;
}

greet('World');
```javascript
function greet(name) {
  console.log(`Hello, ${name}!`);
  return true;
}
```

Code block features

File names

Add a filename after the language to show which file the code belongs to:
server.ts
import express from 'express';

const app = express();
const PORT = 3000;

app.get('/', (req, res) => {
  res.json({ message: 'Hello World' });
});

app.listen(PORT, () => {
  console.log(`Server running on port ${PORT}`);
});
```typescript server.ts
import express from 'express';

const app = express();
// ... rest of code
```

Line highlighting

Highlight specific lines to draw attention to important parts:
def calculate_fibonacci(n):
    if n <= 1:
        return n
    else:
        return calculate_fibonacci(n-1) + calculate_fibonacci(n-2)

# Calculate the 10th Fibonacci number
result = calculate_fibonacci(10)
print(f"The 10th Fibonacci number is: {result}")
```python {3-5}
def calculate_fibonacci(n):
    if n <= 1:
        return n
    else:
        return calculate_fibonacci(n-1) + calculate_fibonacci(n-2)
```

Multi-language examples

Use <CodeGroup> to show the same example in multiple languages:
fetch('https://api.example.com/data', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_TOKEN'
  },
  body: JSON.stringify({
    name: 'John Doe',
    email: 'john@example.com'
  })
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));
<CodeGroup>

```javascript JavaScript
fetch('https://api.example.com/data', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ name: 'John Doe' })
})
```

```python Python
import requests

response = requests.post(
    'https://api.example.com/data',
    json={'name': 'John Doe'}
)
```

</CodeGroup>

Diff syntax

Show code changes using diff syntax with [!code ++] and [!code --]:
function processUser(user) {
  const name = user.name; 
  const { name, email } = user; 
  
  console.log(name);
  console.log(email); 
  
  return name;
  return { name, email }; 
}
```javascript
function processUser(user) {
  const name = user.name; 
  const { name, email } = user; 
  
  return name;
  return { name, email }; 
}
```

Language support

Mintlify supports syntax highlighting for dozens of languages:

JavaScript/TypeScript

javascript, typescript, jsx, tsx

Python

python, py

Go

go, golang

Java

java

C/C++

c, cpp, c++

Rust

rust, rs

Ruby

ruby, rb

PHP

php

Swift

swift

Kotlin

kotlin, kt

Shell

bash, shell, sh

SQL

sql

HTML/CSS

html, css, scss

JSON/YAML

json, yaml, yml

Markdown

markdown, md, mdx

Real-world examples

Configuration file

mintlify.json
{
  "name": "Documentation Starter Kit",
  "logo": {
    "dark": "/logo/dark.svg",
    "light": "/logo/light.svg"
  },
  "favicon": "/favicon.svg",
  "colors": {
    "primary": "#0D9373",
    "light": "#07C983",
    "dark": "#0D9373"
  },
  "topbarLinks": [
    {
      "name": "Support",
      "url": "mailto:support@example.com"
    }
  ],
  "navigation": [
    {
      "group": "Get Started",
      "pages": ["index", "quickstart"]
    }
  ]
}

API request example

interface CreateUserRequest {
  name: string;
  email: string;
  role: 'admin' | 'user';
}

interface User extends CreateUserRequest {
  id: string;
  createdAt: Date;
}

async function createUser(data: CreateUserRequest): Promise<User> {
  const response = await fetch('/api/users', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(data),
  });
  
  if (!response.ok) {
    throw new Error(`HTTP error! status: ${response.status}`);
  }
  
  return await response.json();
}

// Usage
const newUser = await createUser({
  name: 'Jane Doe',
  email: 'jane@example.com',
  role: 'user'
});
Always specify the language for code blocks. It enables syntax highlighting and helps readers understand the context immediately.

Best practices

Show only the relevant code. Omit boilerplate and use comments to indicate omitted sections with // ....
Ensure code examples are correct and tested. Broken examples frustrate users and damage trust.
Use filenames, comments, and surrounding text to explain what the code does and when to use it.
Avoid foo, bar, and baz. Use meaningful variable names that reflect real-world usage.

Build docs developers (and LLMs) love