Corner is an open-source macOS app designed to transform structured text into stunning diagrams
You can easily install Corner by downloading the latest release from the Releases section of this repository.
- Go to the Releases page.
- Download the
.dmg
file for the latest version. - Open the file and follow the instructions to install Corner on your macOS device.
- If you run into a warning regarding "unidentified developer". Follow this link.
- Launch Corner.
Corner language is a simple and flexible way to define diagrams in Corner, an open-source macOS app. This language allows you to define nodes and edges with customizable attributes like colors and labels. Below is a detailed breakdown of the grammar and how to use it effectively.
In Corner language, you define diagrams by declaring nodes and edges. Nodes can have attributes like colors, and edges can have labels. Every diagram starts with at least one node declaration, and nodes can connect to each other through edges.
<Diagram> ::= <NodeDeclaration>
<NodeDeclaration> ::= "node" <identifier> "{" (<NodeAttributes> | | <EdgeDeclaration>)* "}"
<EdgeDeclaration> ::= "calls" <identifier> <EdgeAttributes>
<NodeAttributes> ::= <ColorAttribute>*
<EdgeAttributes> ::= <LabelAttribute>*
<ColorAttribute> ::= "color" ":" <identifier>
<LabelAttribute> ::= "label" ":" "\"" <identifier> "\""
<identifier> ::= [a-zA-Z][a-zA-Z0-9]*
A node in Corner language is declared using the node keyword, followed by an identifier that names the node. The identifier must start with a letter (a-z or A-Z) and can be followed by any combination of letters and digits.
node <identifier> {
<NodeAttributes>*
<EdgeDeclaration>*
}
- <identifier>: A name for the node, e.g.,
node1
,process
, orStartNode
. - The node’s body contains either its attributes or edges to other nodes, and both can appear together or alone
node StartNode {}
This example declares a node named StartNode
.
Node attributes customize the appearance of nodes. Currently, the only supported attribute is color
.
color: <identifier>
- <identifier>: A color name (e.g., red, blue, green). This defines the color of the node.
blue
yellow
red
green
orange
indigo
black
white
mint
cyan
purple
pink
Note
If color is not specified, Corner will assign a random color to the node.
node Process {
color: red
}
This declares a node Process
with the color red.
Edges connect nodes and represent relationships. Edges are declared inside a node, using the calls
keyword, followed by the target node’s identifier. Edges can have a label attribute to describe the relationship.
calls <identifier> {
<EdgeAttributes>*
}
- <identifier>: The name of the target node to which the current node is connected.
- The body of the edge can contain attributes, such as a label.
node StartNode {
calls Process {
label: "initiates"
}
}
This example declares that the node StartNode
calls the node Process
with the label “initiates.”
Edge attributes define characteristics of the connection between two nodes. The currently supported edge attribute is label, which is a string enclosed in double quotes.
label: "<identifier>"
- <identifier>: Any descriptive string for the edge, representing the relationship or action.
calls EndNode {
label: "completes"
}
This example declares that the edge between the current node and EndNode
has the label “completes.”
Nodes can have both attributes and edges. Below is an example combining node color and an edge with a label:
node StartNode {
color: green
calls ProcessNode {
label: "begins"
}
}
This creates a StartNode
with a green color and an edge to ProcessNode
labeled “begins.”
node StartNode {
color: green
calls ProcessNode {
label: "begins"
}
}
node ProcessNode {
color: yellow
calls EndNode {
label: "finishes"
}
}
node EndNode {
color: red
}
StartNode
is green and connects toProcessNode
with the label “begins”.ProcessNode
is yellow and connects toEndNode
with the label “finishes”.EndNode
is red and doesn’t connect to any other nodes.
- If two nodes are aligned either vertically or horizontally, and their edges form a cycle, the edges may overlap.
For more advanced diagrams, future updates may add new attributes and features. Keep checking the repository for updates!