cfdf515228
- .claude/CLAUDE.md - .claude/commands/subagentes.md - .claude/rules/INDEX.md - .mcp.json - bash/functions/cybersecurity/analyze_dns.md - bash/functions/cybersecurity/audit_http_headers.md - bash/functions/cybersecurity/audit_ssh_config.md - bash/functions/cybersecurity/check_firewall.md - bash/functions/cybersecurity/detect_suspicious_users.md - bash/functions/cybersecurity/encrypt_file.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.0 KiB
2.0 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | params | output | tested | tests | test_file_path | file_path | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| prosemirror_card_embed | function | py | infra | 1.0.0 | pure | def prosemirror_card_embed(card_id: int, height: int = 400) -> dict | Genera un nodo ProseMirror cardEmbed envuelto en resizeNode con altura adecuada. Un cardEmbed desnudo renderiza con ~50px — este helper produce el formato que Metabase espera para que la card se vea bien. |
|
false |
|
|
dict ProseMirror: nodo resizeNode > cardEmbed, insertable en el array content de un document | false | python/functions/metabase/documents.py |
Ejemplo
from metabase.documents import metabase_create_document, prosemirror_card_embed
doc = metabase_create_document(client, "Reporte", {
"type": "doc",
"content": [
{"type": "heading", "attrs": {"level": 2},
"content": [{"type": "text", "text": "Revenue"}]},
prosemirror_card_embed(7711, height=500),
{"type": "paragraph",
"content": [{"type": "text", "text": "Datos actualizados."}]},
]
})
Por qué existe este helper
# MAL — cardEmbed desnudo: renderiza con ~50px de alto, ilegible
{"type": "cardEmbed", "attrs": {"id": 42}}
# BIEN — prosemirror_card_embed: envuelto en resizeNode
prosemirror_card_embed(42, height=450)
# → {"type": "resizeNode", "attrs": {"height": 450, "minHeight": 280},
# "content": [{"type": "cardEmbed", "attrs": {"id": 42, "_id": "uuid...", "name": null}}]}
El formato con resizeNode es el que usa el editor de Metabase cuando un usuario inserta una card manualmente — sin él, la card se renderiza diminuta.