This page demonstrates various markdown formatting and documentation patterns you can use in your OkiDoki documentation.
# H1 - Main Title
## H2 - Section Title
### H3 - Subsection
#### H4 - Sub-subsection
##### H5 - Minor Heading
###### H6 - Smallest Heading
Result:
**Bold text** or __bold text__
*Italic text* or _italic text_
***Bold and italic*** or ___bold and italic___
~~Strikethrough text~~
`Inline code`
Result:Bold text, italic text, bold and italic, strikethrough text, inline code
- First item
- Second item
- Nested item
- Another nested item
- Third item
Result:
1. First step
2. Second step
1. Nested step
2. Another nested step
3. Third step
Result:
[Link text](https://example.com)
[Internal link](reference.md)
[Link with title](https://example.com "Example Website")

Result:
```javascript
function calculateTotal(items) {
return items.reduce((sum, item) => {
return sum + (item.price * item.quantity);
}, 0);
}
// Usage
const cartItems = [
{ name: "Book", price: 12.99, quantity: 2 },
{ name: "Pen", price: 1.50, quantity: 5 }
];
console.log(`Total: ${calculateTotal(cartItems)}`);
```
Result:
function calculateTotal(items) {
return items.reduce((sum, item) => {
return sum + (item.price * item.quantity);
}, 0);
}
// Usage
const cartItems = [
{ name: "Book", price: 12.99, quantity: 2 },
{ name: "Pen", price: 1.50, quantity: 5 }
];
console.log(`Total: $${calculateTotal(cartItems)}`);
```python
def fibonacci(n):
"""Generate Fibonacci sequence up to n terms."""
if n <= 0:
return []
elif n == 1:
return [0]
elif n == 2:
return [0, 1]
fib_seq = [0, 1]
for i in range(2, n):
fib_seq.append(fib_seq[i-1] + fib_seq[i-2])
return fib_seq
# Generate first 10 Fibonacci numbers
print(fibonacci(10))
```
```yaml
site:
title: "My API Documentation"
description: "Complete API reference and guides"
theme:
light: "fantasy"
dark: "forest"
globals:
version: "2.1.0"
api_base: "https://api.example.com/v1"
search:
enabled: true
placeholder: "Search API docs..."
```
```bash
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Run tests
npm test
```
| Method | Endpoint | Description | Auth Required |
|--------|----------|-------------|---------------|
| GET | `/users` | List all users | Yes |
| POST | `/users` | Create new user | Yes |
| GET | `/users/{id}` | Get user by ID | Yes |
| PUT | `/users/{id}` | Update user | Yes |
| DELETE | `/users/{id}` | Delete user | Yes |
Result:
Method | Endpoint | Description | Auth Required |
---|---|---|---|
GET | /users | List all users | Yes |
POST | /users | Create new user | Yes |
GET | /users/{id} | Get user by ID | Yes |
PUT | /users/{id} | Update user | Yes |
DELETE | /users/{id} | Delete user | Yes |
> This is a blockquote. It can be used for highlighting important information,
> quotes, or notes.
> **Tip:** You can also use blockquotes for tips and warnings.
Result:
This is a blockquote. It can be used for highlighting important information, quotes, or notes.
Tip: You can also use blockquotes for tips and warnings.
---
***
___
Result:
Use variables defined in your okidoki.yaml
:
# Okidoki Configuration
site:
title: "My Docs"
description: "Docs generated with Okidoki"
theme:
light: "fantasy"
dark: "forest"
version: "1.0.1"
api_url: "https://api.example.com"
support_email: "support@example.com"
author: "**John Doe**"
author_url: "https://example.com"
author_image: "https://example.com/avatar.png"
author_bio: "John Doe is a good man"
author_twitter: "https://twitter.com/johndoe"
author_linkedin: "https://linkedin.com/in/johndoe"
Reference them in your markdown file:
Current version: {{version}}
API endpoint: {{{api_url}}}
Support email: {{{support_email}}}
{{{encoded_content}}}
.Result
Current version: 1.0.40
API endpoint:
Support email:
Create important message callouts using Handlebars alert helpers:
For basic alerts with text only:
{{alert "This is an informational callout." "info"}}
{{alert "This is a success message." "success"}}
{{alert "This is a warning message." "warning"}}
{{alert "This is an error alert." "error"}}
{{alert "This is neutral information."}}
Result:
For alerts with complex content including markdown:
{{#alert type="info"}}
Information alert with **markdown** support and [links](https://example.com)
{{/alert}}
{{#alert type="warning"}}
Warning alert with `code` and multiple lines of content
{{/alert}}
Result:
code
and multiple lines of content{{#alert type="error"}}
β **Error**: Critical code detected!
```javascript
console.log('Be careful with this');
process.exit(1);
```
Please check your [code file](index.js) and ensure that your code is sanitized.
{{/alert}}
Result:
β Error: Critical code detected!
console.log('Be careful with this');
process.exit(1);
Please check your code file and ensure that your code is sanitized.
Here are some examples of the new badge functionality:
{{badge "Default Badge"}}
Result:Default Badge
{{badge "Primary" "primary"}}
{{badge "Secondary" "secondary"}}
{{badge "Accent" "accent"}}
{{badge "Info" "info"}}
{{badge "Success" "success"}}
{{badge "Warning" "warning"}}
{{badge "Error" "error"}}
Result:PrimarySecondaryAccentInfoSuccessWarningError
You can use badges inline like this {{badge "Status: Active" "success"}} within your text content.
Result: You can use badges inline like this Status: Active within your text content.
## Get User {{badge "GET" "primary"}}
## Create User {{badge "POST" "success"}}
## Update User {{badge "PUT" "warning"}}
## Delete User {{badge "DELETE" "error"}}
Result:
# My Project {{badge "v2.1.0" "info"}} {{badge "Stable" "success"}}
Features:
- Authentication {{badge "β
Complete" "success"}}
- Dashboard {{badge "π§ In Progress" "warning"}}
- Analytics {{badge "π Planned" "outline"}}
- Mobile App {{badge "β Deprecated" "error"}}
Result:
Features:
You can also use HTML for more complex formatting:
<div>
<h4>Custom HTML Block</h4>
<p>Sometimes you need more control over the formatting.</p>
<ul>
<li><strong>Bold item</strong></li>
<li><em>Italic item</em></li>
</ul>
</div>
Result:
Sometimes you need more control over the formatting.
This page demonstrates both the old Handlebars tabs syntax and the new markdown tabs syntax.
Create interactive tabbed content using Handlebars helpers:
{{#tabs}}
{{#tab title="JavaScript"}}
```javascript
const message = "Hello from JavaScript!";
console.log(message);
// more code here
```
{{/tab}}
{{#tab title="Python"}}
```python
def main():
# more code here
```
{{/tab}}
{{/tabs}}
Result:
const message = "Hello from JavaScript!";
console.log(message);
// Fetch data from API
fetch('/api/users')
.then(response => response.json())
.then(data => console.log(data));
def main():
message = "Hello from Python!"
print(message)
# Fetch data from API
import requests
try:
response = requests.get('/api/users')
data = response.json()
print(data)
except Exception as e:
print(f"Error: {e}")
if __name__ == "__main__":
main()
# Get users from API
curl -X GET \
'https://api.example.com/users' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer your-token'
Hereβs some regular markdown content in a tab.
Note: This tab contains mixed content - not just code!
interface User {
id: number;
name: string;
email: string;
}
class UserService {
async getUser(id: number): Promise<User> {
const response = await fetch(`/api/users/${id}`);
return response.json();
}
}
# config.yml
api:
baseUrl: "https://api.example.com"
timeout: 30000
retries: 3
features:
enableCache: true
enableLogging: true
enableMetrics: false
This comprehensive example should give you a solid foundation for creating rich, well-formatted documentation with OkiDoki!