Skip to content

DSL Overview

The Topolix DSL (Domain-Specific Language) is a simple, human-readable syntax for defining architecture diagrams. It is designed to be version-control friendly and easy to learn.

A Topolix diagram consists of four building blocks:

Element Purpose Example
Node A single component (service, database, etc.) node id="api" title="API Server"
Group A container for related nodes group id="backend" title="Backend" { ... }
Table A multi-column data display table id="endpoints" { ... }
Edge A connection between two elements edge from="api" to="db" label="SQL"

Every element starts with a keyword (node, group, table, edge) followed by attributes as key="value" pairs:

keyword key1="value1" key2="value2"

Elements that contain children use curly braces:

keyword id="myid" title="My Title" {
# children go here
}

Attributes use key="value" syntax. Quotes are required when values contain spaces:

node id="web-app" title="Web Application"

For simple values without spaces, quotes are optional:

node id=app title=App

Lines starting with # are comments and are ignored by the parser:

# This is a comment
node id="app" title="My App"
# A simple three-tier architecture
node id="web" title="Web App" shape="browser"
node id="api" title="API Server" shape="server"
node id="db" title="Database" shape="cylinder"
edge from="web" to="api" label="REST"
edge from="api" to="db" label="SQL"
  • Nodes — define individual components
  • Groups — organize nodes into containers
  • Tables — display structured data
  • Edges — connect elements together
  • Shapes — all available node shapes
  • Icons — add icons to nodes and groups
  • Colors — customize element colors