{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 3, "name": "blockenberg/code-tabs", "title": "Code Tabs", "description": "Multi-language tabbed code viewer with syntax highlighting. Show the same snippet in JavaScript, Python, PHP, and more.", "category": "bkbg-dev", "icon": "editor-code", "keywords": [ "code", "tabs", "syntax", "highlight", "developer", "programming", "snippet", "multi-language" ], "editorScript": "bkbg-code-tabs-editor", "editorStyle": "bkbg-code-tabs-style", "style": "bkbg-code-tabs-style", "viewScript": "bkbg-code-tabs-frontend", "supports": { "html": false, "anchor": true, "className": true, "align": [ "wide", "full" ] }, "attributes": { "tabs": { "type": "array", "default": [ { "label": "JavaScript", "lang": "javascript", "fileName": "index.js", "code": "async function fetchUser(id) {\n const res = await fetch(`/api/users/${id}`);\n if (!res.ok) throw new Error('Not found');\n return res.json();\n}\n\nconst user = await fetchUser(42);\nconsole.log(user.name);" }, { "label": "Python", "lang": "python", "fileName": "main.py", "code": "import requests\n\ndef fetch_user(user_id: int) -> dict:\n res = requests.get(f'/api/users/{user_id}')\n res.raise_for_status()\n return res.json()\n\nuser = fetch_user(42)\nprint(user['name'])" }, { "label": "PHP", "lang": "php", "fileName": "index.php", "code": "