Skip to content

Code Blocks

Code blocks support VitePress-style enhancements:

  • copy button
  • language label
  • optional title bar via data-title
  • file-type icon in title bar inferred from file extension/language

Syntax colors come from Rouge themes configured in _config.yml:

vp_theme:
  rouge_theme:
    light: github
    dark: github.dark

Titled block example

class WeatherTool
  def call(city:)
    "sunny in #{city}"
  end
end
export function formatDate(input: string): string {
  return new Date(input).toISOString()
}

light and dark accept any installed Rouge theme name.