Configuration File
Emlang uses a .emlang.yaml file for project configuration. The CLI resolves the configuration file in the following order:
- The
-cflag:emlang -c path/to/config.yaml - The
EMLANG_CONFIGenvironment variable - A
.emlang.yamlfile in the current working directory
lint
Configuration for the linter. Use the ignore list to disable specific rules.
lint.ignore
Type: array of strings — list of rule names to ignore.
lint:
ignore:
- slice-missing-event
- command-without-event
Available Rules
| Rule | Severity | Description |
|---|---|---|
command-without-event |
warning | Command not followed by event or exception |
orphan-exception |
warning | Exception without preceding command |
slice-missing-event |
warning | Slice without events |
fmt
Configuration for the formatter.
fmt.keys
Type: string — key style for formatted output. Options: "long" or "short". Default: "long".
long— full type names:trigger,command,event,exception,viewshort— abbreviated keys:t,c,e,x,v
fmt:
keys: long
diagram
Configuration for the generated diagram.
diagram.serve
Settings for the live-reload server started with emlang diagram --serve.
diagram.serve.address
Type: string — listen address. Default: "127.0.0.1".
diagram.serve.port
Type: int — listen port. Default: 8274.
diagram:
serve:
address: 127.0.0.1
port: 8274
diagram.css
Use the css map to override default CSS custom properties.
Type: map of string to string — CSS variable name to value.
diagram:
css:
--command-color: "#dbe4ff"
--font-size-label: "0.8em"
Available CSS Variables
| Variable | Default | Description |
|---|---|---|
| Colors | ||
--text-color |
#212529 |
Main text color |
--border-color |
#ced4da |
Border color |
--trigger-color |
#e9ecef |
Trigger background |
--command-color |
#a5d8ff |
Command background |
--event-color |
#ffd8a8 |
Event background |
--exception-color |
#ffc9c9 |
Exception background |
--view-color |
#b2f2bb |
View background |
| Sizes | ||
--item-border-radius |
0.5em |
Border radius |
| Typography | ||
--font-family-normal |
system-ui |
Normal font family |
--font-size-slicename |
2em |
Slice name font size |
--font-weight-slicename |
normal |
Slice name font weight |
--font-size-swimlane |
1.5em |
Swimlane font size |
--font-weight-swimlane |
normal |
Swimlane font weight |
--font-size-testname |
1em |
Test name font size |
--font-weight-testname |
bold |
Test name font weight |
--font-size-label |
0.75em |
Label font size |
--font-weight-label |
normal |
Label font weight |
--font-family-props |
monospace |
Props font family |
--font-size-props |
0.75em |
Props font size |
--font-weight-props |
normal |
Props font weight |
Full Example
A complete .emlang.yaml configuration file with all available options:
# Emlang configuration file
lint:
ignore:
- slice-missing-event
- command-without-event
- orphan-exception
fmt:
keys: long
diagram:
serve:
address: 127.0.0.1
port: 8274
css:
# Colors
--text-color: "#212529"
--border-color: "#ced4da"
--trigger-color: "#e9ecef"
--command-color: "#a5d8ff"
--event-color: "#ffd8a8"
--exception-color: "#ffc9c9"
--view-color: "#b2f2bb"
# Sizes
--item-border-radius: "0.5em"
# Typography
--font-family-normal: "system-ui"
--font-size-slicename: "2em"
--font-weight-slicename: "normal"
--font-size-swimlane: "1.5em"
--font-weight-swimlane: "normal"
--font-size-testname: "1em"
--font-weight-testname: "bold"
--font-size-label: "0.75em"
--font-weight-label: "normal"
--font-family-props: "monospace"
--font-size-props: "0.75em"
--font-weight-props: "normal"