generated from just-the-docs/just-the-docs-template
-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds more docs re: custom elements and views.
- Loading branch information
1 parent
66ed3a0
commit 95efb79
Showing
8 changed files
with
128 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
workspace { | ||
|
||
model { | ||
a = softwareSystem "A" | ||
b = element "B" "Hardware System" | ||
|
||
a -> b "Sends control signals to" | ||
} | ||
|
||
views { | ||
systemContext a "Diagram1" { | ||
include * | ||
autoLayout lr | ||
} | ||
} | ||
|
||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
layout: default | ||
title: Custom elements | ||
parent: Cookbook | ||
grand_parent: Structurizr DSL | ||
permalink: /dsl/cookbook/custom-elements/ | ||
--- | ||
|
||
# Custom elements | ||
|
||
The DSL [element](/dsl/language#element) keyword can be used to define elements that sit outside of the C4 model. | ||
For example, perhaps a software system named A controls a hardware system named B. | ||
|
||
``` | ||
workspace { | ||
model { | ||
a = softwareSystem "A" | ||
b = element "B" "Hardware System" | ||
a -> b "Sends control signals to" | ||
} | ||
views { | ||
systemContext a "Diagram1" { | ||
include * | ||
autoLayout lr | ||
} | ||
} | ||
} | ||
``` | ||
|
||
[![](example-1.png)](http://structurizr.com/dsl?src=https://docs.structurizr.com/dsl/cookbook/custom-elements/example-1.dsl) | ||
|
||
## Links | ||
|
||
- [DSL language reference - element](/dsl/language#element) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
workspace { | ||
|
||
model { | ||
a = element "A" "Type A" "A description of A." | ||
b = element "B" "Type B" "A description of B." | ||
|
||
a -> b "Depends upon" | ||
} | ||
|
||
views { | ||
custom "Diagram1" { | ||
title "A custom view" | ||
include * | ||
autoLayout lr | ||
} | ||
} | ||
|
||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
layout: default | ||
title: Custom view | ||
parent: Cookbook | ||
grand_parent: Structurizr DSL | ||
permalink: /dsl/cookbook/custom-view/ | ||
--- | ||
|
||
# Custom view | ||
|
||
A [custom view](/ui/diagrams/custom-view) provides a way to create ad hoc diagrams, based upon the | ||
same model+view approach and rendering engine. | ||
|
||
``` | ||
workspace { | ||
model { | ||
a = element "A" "Type A" "A description of A." | ||
b = element "B" "Type B" "A description of B." | ||
a -> b "Depends upon" | ||
} | ||
views { | ||
custom "Diagram1" { | ||
title "A custom view" | ||
include * | ||
autoLayout lr | ||
} | ||
} | ||
} | ||
``` | ||
|
||
This DSL defines a custom view showing a couple of custom elements. | ||
|
||
[![](example-1.png)](http://structurizr.com/dsl?src=https://docs.structurizr.com/dsl/cookbook/custom-view/example-1.dsl) | ||
|
||
## Links | ||
|
||
- [DSL language reference - element](/dsl/language#element) | ||
- [DSL language reference - custom](/dsl/language#custom-view) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters