structurizr / dsl

Structurizr DSL
https://docs.structurizr.com/dsl
Apache License 2.0
1.41k stars 265 forks source link

Multi-line Strings #137

Closed erwanosouf closed 1 year ago

erwanosouf commented 2 years ago

Is there a way to have multiline strings in the DSL ?

This would allow for easier readability of long fields such as descriptions or perspectives. Also what is the proper way to introduce line breaks for rendering in such fields ?

I saw that \n seems to work, but using line breaks for the source DSL file would be great !

simonbrowndotje commented 2 years ago

The DSL parser is designed to work with line breaks, so multi-line strings are not supported I'm afraid.

aidmax commented 2 years ago

Also, struggling with readability looking at long description lines :(

Kaligule commented 1 year ago

One way to make this possible without breaking the current syntax would be to allow for multiple description lines. Then, instead of using the value of the last value, concatinate them with separating \n.

Example

description "aaa"
description "bbb"
description "ccc"

This currently results in the description "ccc", but could be changed to result in "aaa\nbbb\nccc"

simonbrowndotje commented 1 year ago

This will be available in the next version of the DSL library - you'll be able to use a backslash character to split lines.