structurizr / cli

A command line utility for Structurizr.
https://docs.structurizr.com/cli
Apache License 2.0
501 stars 77 forks source link

Mermaid websequence diagram property example #93

Closed msnm closed 1 year ago

msnm commented 1 year ago

Hey Simon

I want to export via the CLI mermaid sequence diagrams. According to the code base, this seems possible by defining the property mermaid.sequenceDiagram true

I've added this to the view section in the workspace.dsl. Here a small example

workspace {

    model {
        user = person "User"
        softwareSystem = softwareSystem "Software System" {
            webapp = container "Web Application"
            bus = container "Message Bus"
            app1 = container "App 1"
            app2 = container "App 2"
        }

        user -> webapp "Updates details"
        webapp -> bus "Sends update event"
        bus -> app1 "Broadcasts update event"
        bus -> app2 "Broadcasts update event"
    }

    views {
        dynamic softwareSystem {
            user -> webapp
            webapp -> bus
            {
                bus -> app1
            }
            {
                bus -> app2
            }

            autoLayout
        }
        properties {
            mermaid.sequenceDiagram true
        }
    }

}

When performing the following CLi command this results in the same mermaid diagrams as without the property set on the view.

structurizr-cli export -o generated/mermaid/ -w . -f mermaid

Is it possible to add an example of how this feature works? Mermaid is easy to render in markdown and I'm setting up an Obsidian based Structurizr documentation workflow. Personal Knowledge Graphs and Structurizr seem like a nice fit.

Lots of Kudos

Michael

simonbrowndotje commented 1 year ago

That change was only made 3 days ago, and isn't yet reflected in the current version of the CLI -> https://github.com/structurizr/export/commit/631f598f92ad9b1e80e0230b532129a2f49e9868.

The previous name (mermaid.sequenceDiagrams) should work instead.

simonbrowndotje commented 1 year ago

mermaid.sequenceDiagram will now work in the latest version of the CLI.