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.
Core Concepts
Section titled “Core Concepts”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" |
Basic Syntax
Section titled “Basic Syntax”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}Attribute Format
Section titled “Attribute Format”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=AppComments
Section titled “Comments”Lines starting with # are comments and are ignored by the parser:
# This is a commentnode id="app" title="My App"Minimal Example
Section titled “Minimal Example”# A simple three-tier architecturenode 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"