Menu

Rich cards, tables and panels (preview)

A card can say what it is, stress a word, carry a table or a finding; a diagram can have a legend, a footnote and panels set around the drawing. None of it needs a new tag: lines |, Markdown, classes and at=.

Category, emphasis and states

{"skemo":1,"name":"rich-card.skemo","source":"diagram(dir=\"right\" lang=\"en\")\n card#api.service(label=\"ECS service (Fargate)\" tag=\"module.app\") api\n | `python3.12` · autoscaling **2–12**\n | logs kept *30 days*\n to(db) 5432\n card#db.store.warn(label=\"RDS PostgreSQL 16.4\" tag=\"module.data\") orders\n | db.r6g.large · Multi-AZ\n |.warn single-AZ replica\n | backups: ==none==\n","css":[{"name":"rich-card.css","content":".service { --c: #3E6FC4; }\n.store { --c: #B45309; }\n"}],"theme":"light"}ECS SERVICE (FARGATE)apimodule.apppython3.12 · autoscaling 2–12logs kept 30 daysRDS POSTGRESQL 16.4ordersmodule.datadb.r6g.large · Multi-AZsingle-AZ replicabackups: none5432
{"skemo":1,"name":"rich-card.skemo","source":"diagram(dir=\"right\" lang=\"en\")\n card#api.service(label=\"ECS service (Fargate)\" tag=\"module.app\") api\n | `python3.12` · autoscaling **2–12**\n | logs kept *30 days*\n to(db) 5432\n card#db.store.warn(label=\"RDS PostgreSQL 16.4\" tag=\"module.data\") orders\n | db.r6g.large · Multi-AZ\n |.warn single-AZ replica\n | backups: ==none==\n","css":[{"name":"rich-card.css","content":".service { --c: #3E6FC4; }\n.store { --c: #B45309; }\n"}],"theme":"dark"}ECS SERVICE (FARGATE)apimodule.apppython3.12 · autoscaling 2–12logs kept 30 daysRDS POSTGRESQL 16.4ordersmodule.datadb.r6g.large · Multi-AZsingle-AZ replicabackups: none5432
rich-card.skemo
diagram(dir="right" lang="en")
  card#api.service(label="ECS service (Fargate)" tag="module.app") api
    | `python3.12` · autoscaling **2–12**
    | logs kept *30 days*
    to(db) 5432
  card#db.store.warn(label="RDS PostgreSQL 16.4" tag="module.data") orders
    | db.r6g.large · Multi-AZ
    |.warn single-AZ replica
    | backups: ==none==
rich-card.css
.service { --c: #3E6FC4; }
.store   { --c: #B45309; }
WriteEffect
label="RDS PostgreSQL 16.4"the card's category, a small line above its name; by default the type's --label; label="" shows none. tag= stays the chip on the right
**bold**, *italic*, `mono`Markdown emphasis inside a line or a table cell
==text==, ==.ok text==a mark: in red, or the colour of the line's state, or of the class written after ==
.ok, .warn, .erroron a card: a ring and a mark before the name; on a line (|.warn …): a mark and the state's colour; on a cell: the state's colour

Delimiters only count when they wrap a word: cron(0 2 * * ? *) and status == 200 stay as written, and _ is never emphasis. Write \*, \` or \== for the characters themselves.

Tables

{"skemo":1,"name":"table.skemo","source":"diagram(lang=\"en\")\n card#sg(label=\"Security groups\") Ingress\n | All groups allow all egress.\n | Group | Inbound | Attached to |\n |--------|----------------------------|---------------|\n | alb | 443, 80 from ==0.0.0.0/0== | load balancer |\n | api | 8080 from alb | ECS api tasks |\n | ^^ | 9090 from monitoring | ECS api tasks |\n | worker | no inbound rule ||\n |.error lambda | none | order_events |\n","theme":"light"}SECURITY GROUPSIngressAll groups allow all egress.GROUPINBOUNDATTACHED TOalb443, 80 from 0.0.0.0/0load balancerapi8080 from albECS api tasks9090 from monitoringECS api tasksworkerno inbound rulelambdanoneorder_events
{"skemo":1,"name":"table.skemo","source":"diagram(lang=\"en\")\n card#sg(label=\"Security groups\") Ingress\n | All groups allow all egress.\n | Group | Inbound | Attached to |\n |--------|----------------------------|---------------|\n | alb | 443, 80 from ==0.0.0.0/0== | load balancer |\n | api | 8080 from alb | ECS api tasks |\n | ^^ | 9090 from monitoring | ECS api tasks |\n | worker | no inbound rule ||\n |.error lambda | none | order_events |\n","theme":"dark"}SECURITY GROUPSIngressAll groups allow all egress.GROUPINBOUNDATTACHED TOalb443, 80 from 0.0.0.0/0load balancerapi8080 from albECS api tasks9090 from monitoringECS api tasksworkerno inbound rulelambdanoneorder_events
table.skemo
diagram(lang="en")
  card#sg(label="Security groups") Ingress
    | All groups allow all egress.
    | Group  | Inbound                    | Attached to   |
    |--------|----------------------------|---------------|
    | alb    | 443, 80 from ==0.0.0.0/0== | load balancer |
    | api    | 8080 from alb              | ECS api tasks |
    | ^^     | 9090 from monitoring       | ECS api tasks |
    | worker | no inbound rule           ||
    |.error lambda | none                 | order_events  |

A table is written as a Markdown table inside a card: a line that ends with | is a row, rows that follow each other are one table, and the card can hold lines of text before and after it. The spaces around a cell are trimmed, so a table aligned by any Markdown formatter stays valid.

WriteEffect
|---|---| after the first rowthe first row is a header; :---: centres a column, ---: aligns it right
|| (nothing in the cell)the cell on the left spans this column too; an empty cell is | |
^^the cell above spans this row too
|.error lambda |the cell takes the class (glued to the bar)
| alonean empty line; it also separates two tables

A table never wraps: its card grows as wide as it needs. Arrows end on the card, not on a row.

Legends and plain text

{"skemo":1,"name":"legend.skemo","source":"diagram(dir=\"right\" lang=\"en\")\n card#web.service Web\n to(api).user HTTPS\n card#api.service API\n to(queue).events jobs\n card#queue.store Queue\n card#flows.legend Flows\n |.user user request\n |.events events / queues\n |.warn finding worth reviewing\n card#auto.legend Automatic\n","css":[{"name":"legend.css","content":".service { --c: #3E6FC4; --label: \"Service\"; }\n.store { --c: #B45309; --label: \"Data store\"; }\n.edge.user { color: #3E6FC4; --label: \"user request\"; }\n.edge.events { color: #D97706; --label: \"events\"; }\n.edge.events .line { stroke-dasharray: 5 4; }\n"}],"theme":"light"}SERVICEWebSERVICEAPIDATA STOREQueueFlowsuser requestevents / queuesfinding worth reviewingAutomaticuser requesteventsServiceData storeHTTPSjobs
{"skemo":1,"name":"legend.skemo","source":"diagram(dir=\"right\" lang=\"en\")\n card#web.service Web\n to(api).user HTTPS\n card#api.service API\n to(queue).events jobs\n card#queue.store Queue\n card#flows.legend Flows\n |.user user request\n |.events events / queues\n |.warn finding worth reviewing\n card#auto.legend Automatic\n","css":[{"name":"legend.css","content":".service { --c: #3E6FC4; --label: \"Service\"; }\n.store { --c: #B45309; --label: \"Data store\"; }\n.edge.user { color: #3E6FC4; --label: \"user request\"; }\n.edge.events { color: #D97706; --label: \"events\"; }\n.edge.events .line { stroke-dasharray: 5 4; }\n"}],"theme":"dark"}SERVICEWebSERVICEAPIDATA STOREQueueFlowsuser requestevents / queuesfinding worth reviewingAutomaticuser requesteventsServiceData storeHTTPSjobs
legend.skemo
diagram(dir="right" lang="en")
  card#web.service Web
    to(api).user HTTPS
  card#api.service API
    to(queue).events jobs
  card#queue.store Queue
  card#flows.legend Flows
    |.user user request
    |.events events / queues
    |.warn finding worth reviewing
  card#auto.legend Automatic
legend.css
.service { --c: #3E6FC4; --label: "Service"; }
.store   { --c: #B45309; --label: "Data store"; }
.edge.user   { color: #3E6FC4; --label: "user request"; }
.edge.events { color: #D97706; --label: "events"; }
.edge.events .line { stroke-dasharray: 5 4; }

card.legend is a legend: each line |.class text shows a sample of the class it names, an arrow for a class used on arrows, a chip for a card type, a small frame for a zone type, the icon of a class that sets --icon, the mark for a state. A legend without lines lists by itself the classes of the diagram that have a --label in the stylesheet (arrow classes too: .edge.events { --label: "events"; }). card.text is plain text with no frame, for a note or a footnote.

Panels, legends and footnotes around the drawing

{"skemo":1,"name":"docking.skemo","source":"diagram(dir=\"right\" lang=\"en\")\n title Shop platform\n | Production · eu-west-3 · 106 resources\n |.pill prod\n card#users Customers\n to(alb) HTTPS\n zone#vpc.net VPC 10.20.0.0/16\n | 3 availability zones\n card#alb(label=\"Load balancer\") shop-prod\n to(api) :8080\n card#api(label=\"ECS service\") api\n zone#sec(at=\"s\") Security\n card#kms(label=\"KMS key\") alias/shop\n | encrypts RDS, SQS, S3\n zone#ops(at=\"s\") Monitoring\n card#alarms(label=\"CloudWatch\") 3 alarms\n to(sns)\n card#sns(label=\"SNS topic\") alerts\n card#key.legend(at=\"ne\") Key\n |.net network\n card.text.wide(at=\"s\")\n | Omitted for clarity: route tables, IAM policy attachments.\n","css":[{"name":"docking.css","content":".net { --c: #0F766E; }\n"}],"theme":"light"}CustomersVPC 10.20.0.0/163 availability zonesLOAD BALANCERshop-prodECS SERVICEapiSECURITYKMS KEYalias/shopencrypts RDS, SQS, S3MONITORINGCLOUDWATCH3 alarmsSNS TOPICalertsKeynetworkOmitted for clarity: route tables, IAM policy attachments.Shop platformprodProduction · eu-west-3 · 106 resourcesHTTPS:8080
{"skemo":1,"name":"docking.skemo","source":"diagram(dir=\"right\" lang=\"en\")\n title Shop platform\n | Production · eu-west-3 · 106 resources\n |.pill prod\n card#users Customers\n to(alb) HTTPS\n zone#vpc.net VPC 10.20.0.0/16\n | 3 availability zones\n card#alb(label=\"Load balancer\") shop-prod\n to(api) :8080\n card#api(label=\"ECS service\") api\n zone#sec(at=\"s\") Security\n card#kms(label=\"KMS key\") alias/shop\n | encrypts RDS, SQS, S3\n zone#ops(at=\"s\") Monitoring\n card#alarms(label=\"CloudWatch\") 3 alarms\n to(sns)\n card#sns(label=\"SNS topic\") alerts\n card#key.legend(at=\"ne\") Key\n |.net network\n card.text.wide(at=\"s\")\n | Omitted for clarity: route tables, IAM policy attachments.\n","css":[{"name":"docking.css","content":".net { --c: #0F766E; }\n"}],"theme":"dark"}CustomersVPC 10.20.0.0/163 availability zonesLOAD BALANCERshop-prodECS SERVICEapiSECURITYKMS KEYalias/shopencrypts RDS, SQS, S3MONITORINGCLOUDWATCH3 alarmsSNS TOPICalertsKeynetworkOmitted for clarity: route tables, IAM policy attachments.Shop platformprodProduction · eu-west-3 · 106 resourcesHTTPS:8080
docking.skemo
diagram(dir="right" lang="en")
  title Shop platform
    | Production · eu-west-3 · 106 resources
    |.pill prod
  card#users Customers
    to(alb) HTTPS
  zone#vpc.net VPC 10.20.0.0/16
    | 3 availability zones
    card#alb(label="Load balancer") shop-prod
      to(api) :8080
    card#api(label="ECS service") api
  zone#sec(at="s") Security
    card#kms(label="KMS key") alias/shop
      | encrypts RDS, SQS, S3
  zone#ops(at="s") Monitoring
    card#alarms(label="CloudWatch") 3 alarms
      to(sns)
    card#sns(label="SNS topic") alerts
  card#key.legend(at="ne") Key
    |.net network
  card.text.wide(at="s")
    | Omitted for clarity: route tables, IAM policy attachments.
docking.css
.net { --c: #0F766E; }

at= with a compass point docks a top-level card or zone outside the drawing, which is laid out as if it were absent: nothing in it moves.

WriteWhere
at="s", at="n"a band below (above) the drawing, over the whole width; several elements go side by side in writing order; a .wide one takes a row of its own (a footnote: card.text.wide(at="s"))
at="e", at="w"a column on the right (left) of the drawing
at="ne", at="nw", at="se", at="sw"in that column, at the top or the bottom: a legend at the top right is at="ne"

A docked zone is laid out on its own, like a small diagram. An arrow between a docked element and the rest of the drawing is not drawn (warning docked-arrow).

Subtitle and zone descriptions

Lines | under title are subtitle lines; |.pill lines are pills on the title's row. Lines under a zone are a description under its title (“3 availability zones”); the zone keeps room for them.