Embedding diagrams and images

This page showcases the ability to embed diagrams and static images in documentation.

Embedding diagrams

Diagrams can be embedded using the embed: syntax:

![System Landscape Diagram](embed:SystemLandscape)

See also: https://www.structurizr.com/help/documentation/diagrams

Example: Embedded diagram

<size:24>System Landscape View</size> System Landscape View Big Bank plc Customer Service Staff[Person] Customer service staff within thebank. Back Office Staff[Person] Administration and support staffwithin the bank. Mainframe Banking System[Software System] Stores all of the core bankinginformation about customers,accounts, transactions, etc. E-mail System[Software System] The internal Microsoft Exchangee-mail system. ATM[Software System] Allows customers to withdraw cash. Internet Banking System[Software System] Allows customers to viewinformation about their bankaccounts, and make payments. Personal Banking Customer[Person] A customer of the bank, withpersonal bank accounts. Acquirer[Software System] Facilitates PIN transactions formerchants. Views account balances, and makes payments using Gets account information from, and makes payments using Sends e-mail using Sends e-mails to Asks questions to[Telephone] Uses Withdraws cash using Uses Uses Peforms clearing and settlement
System Landscape Diagram

Embedding static images

Static assets can be included in the generated site, using the --assets-dir command-line flag. This flag can be used with the serve command and the generate-site command.

When, for example, you would like to embed a nice picture which is located in the pictures directory under the assets directory, you can do that as follows:

![A nice picture](/pictures/nice-picture.png)

Example: Embedded picture

Sun, by Christian Scheja

A nice picture

Embedding PlantUML diagrams

Structurizr Site Generatr supports rendering PlantUML embedded in Markdown files.

Sequence diagram example

```puml
@startuml
Foo -> Bar: doSomething()
@enduml
```
Foo Bar Foo Foo Bar Bar doSomething()

Class diagram example

```puml
@startuml
class Foo {
    +property: String
    +foo()
}

class Bar {
    -privateProperty: String
    +bar()
}

Foo ..> Bar: Uses
@enduml
```
Foo property: String foo() Bar privateProperty: String bar() Uses

Embedding mermaid diagrams

Structurizr Site Generatr is supporting mermaid diagrams in markdown pages using the actual mermaid.js version. Therefore every diagram type, supported by mermaid may be used in markdown documentation files.

  • flowchart
  • sequence diagram
  • class diagram
  • state diagram
  • entity-relationship diagram
  • user journey
  • gantt chart
  • pie chart
  • requirement diagram
  • and some more

Please find the full list of supported chart types on mermaid.js.org/intro

Flowchart Diagram Example

```mermaid
graph TD;
  A-->B;
  A-->C;
  B-->D;
  C-->D;
```
graph TD;
  A-->B;
  A-->C;
  B-->D;
  C-->D;

Sequence Diagram Example

```mermaid
sequenceDiagram
    participant Alice
    participant Bob
    Alice->>John: Hello John, how are you?
    loop Healthcheck
        John->>John: Fight against hypochondria
    end
    Note right of John: Rational thoughts <br/>prevail!
    John-->>Alice: Great!
    John->>Bob: How about you?
    Bob-->>John: Jolly good!
```
sequenceDiagram
    participant Alice
    participant Bob
    Alice->>John: Hello John, how are you?
    loop Healthcheck
        John->>John: Fight against hypochondria
    end
    Note right of John: Rational thoughts <br/>prevail!
    John-->>Alice: Great!
    John->>Bob: How about you?
    Bob-->>John: Jolly good!