Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#255 All $label and $techn supports line breaks #261

Merged
merged 1 commit into from
Nov 15, 2022

Conversation

kirchsth
Copy link
Member

implement #255

All $labels and missing $techn args support line breaks too (I think now we cover all with \n).

It can be tested with my extended branch

@startuml
' convert it with additional command line argument -DRELATIVE_INCLUDE="./.." to use locally
!if %variable_exists("RELATIVE_INCLUDE")
  !include %get_variable_value("RELATIVE_INCLUDE")/C4_Component.puml
  !include %get_variable_value("RELATIVE_INCLUDE")/C4_Deployment.puml
!else
  !include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Component.puml
  !include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Deployment.puml
!endif

Enterprise_Boundary(eb, "Enterprise\nBoundary") {
  Person(p1, "Normal\nUser\nLabel", "Description\nLine\nBreak")
  Container(c1, "Container\nLabel", "container techn\nwith line break", "Description\nLine\nBreak")
  Component(c2, "Component\nLabel", component techn\nwith line break", "Description\nLine\nBreak")
}

System_Ext(s1, "System Label\nWith\nLineBreak", "Description\nLine\nBreak")

Rel_(p1, c1, "A relation\nwith custom direction", "o-DOWN->>")
Rel_(p1, c2, "A relation\nwith custom direction", "and technology\nwith LBs", "o-RIGHT-o")

Rel(c1, c2, "A label\nwith\nline breaks", "and technology\nwith LBs")
Rel(c1, s1, "A linked label\nwith\nline breaks", "and technology\nwith LBs", $link = "http://www.plantuml.com")

Node(n1, "A node label\nwith\nline breaks", "type with\nline break", "description\nwith line break")
Node(n2, "A node label", "PlantUML packages have no automatic line breaks, line breaks are automatically inserted into type", "PlantUML packages have no automatic line breaks, line breaks are automatically inserted into description") {
  Container(cInNode, "A container in node")
}

!if %variable_exists("RELATIVE_INCLUDE")
  !include %get_variable_value("RELATIVE_INCLUDE")/C4_Dynamic.puml
!else
  !include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Dynamic.puml
!endif

Component(from, "From component")
Component(to, "To component")

Rel_("pre1", from, to, "A custom dynamic relation\nwith custom direction", "o-DOWN->>")
Rel_("pre2", from, to, "A custom dynamic relation\nwith custom direction", "and technology\nwith LBs", "+--+")
Rel(from, to, "A dynamic relation\nwith line break")
@enduml

Best regards
Helmut

@kirchsth kirchsth added this to the v2.5.0 milestone Nov 14, 2022
@kirchsth kirchsth merged commit 8d08100 into plantuml-stdlib:master Nov 15, 2022
@kirchsth kirchsth deleted the feature/labelLineBreak branch November 15, 2022 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants