Iris Docs
Code Blocks
Display code with syntax highlighting in multiple languages
Last updated: January 2025
Display code with syntax highlighting in multiple languages:
Python Example
def greet(name: str) -> str: """Greet a person by name.""" return f"Hello, {name}!"# Example usagemessage = greet("Iris")print(message) # Output: Hello, Iris!TypeScript Example
interface User { id: string; name: string; email: string;}function createUser(name: string, email: string): User { return { id: crypto.randomUUID(), name, email, };}const user = createUser("Alice", "alice@example.com");console.log(user);Bash Example
#!/bin/bash# Install dependenciesnpm install# Build the projectnpm run build# Start the servernpm startSupported Languages: Python, TypeScript, JavaScript, Bash, HTML, CSS, JSON, SQL, and many more. Syntax highlighting is powered by Shiki.