diff --git a/.vscode/C4.code-snippets b/.vscode/C4.code-snippets index 2bdb30c..eafe8df 100644 --- a/.vscode/C4.code-snippets +++ b/.vscode/C4.code-snippets @@ -564,5 +564,16 @@ "LAYOUT_AS_SKETCH()" ], "description": "Sketch layout for C4 diagram." - } + }, + "C4_Auto_Number_Relationships": { + "scope": "plantuml", + "prefix": [ + "Autonumber relationships", + "Add relationship numbers" + ], + "body": [ + "AUTONUMBER_RELATIONSHIPS()" + ], + "description": "Automatically add relationship numbers to C4 diagram." + }, } \ No newline at end of file diff --git a/LayoutOptions.md b/LayoutOptions.md index ec984e4..14c993a 100644 --- a/LayoutOptions.md +++ b/LayoutOptions.md @@ -139,4 +139,26 @@ Rel(web_app, twitter, "Gets tweets from", "HTTPS") ![HIDE_STEREOTYPE Sample](https://www.plantuml.com/plantuml/png/NL1DIyD05BplhrZheIdKX8edJuqrMC5gQ5B5KzWcJxkmN-o-DHJnl_j2gnNtCl1ctfkPdGSK7gDMV7b_MpHLNQoBf_grB7Wbj5F0pgHfLUo0xn1TkCuoB_hqNU8kRcC0trg3O31jhSv4vwKm7ogwc2skBaeb36vM3vaI205fr2n8BQG1dpgoPEoVPp9Xh0GVh4b4fwMPyb4-e0pe1Le_ch1g7n1qSsEZwOJV9-rioiU7gEC9_sIStgzBqiEs4SxHdHVOyjmv9Lk1qfeHZHRdKvvNPVfOrBJYWL-cCxvwNWnShfJj0nyQ1ewMKpqdIAAZGabUlEub8dYEKeCYhq3Plexf4ZoGTESe8vAjGVsqEiNQ1DeaNDPrMP5g4FsofpDtW1IZXm7UlDL_L-PWElhCRm00 "HIDE_STEREOTYPE Sample") +## AUTONUMBER_RELATIONSHIPS() +Automatically prefix your relationships with an auto-incremented index. Useful for complex sequences of events, callbacks, and other unclear relationships + +```csharp +@startuml AUTONUMBER_RELATIONSHIPS Sample +!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml + +HIDE_STEREOTYPE() +AUTONUMBER_RELATIONSHIPS() + +Person(admin, "Administrator") +System_Boundary(c1, 'Sample') { + Container(web_app, "Web Application", "C#, ASP.NET Core 2.1 MVC", "Allows users to compare multiple Twitter timelines") + ContainerDb(db, "Database", "SQL Server", "Stores comparison info") +} +System(twitter, "Twitter") + +Rel(admin, web_app, "Uses", "HTTPS") +Rel(web_app, twitter, "Gets tweets from", "HTTPS") +Rel_Right(web_app, db, "Stores", "SQL") +@enduml +``` diff --git a/README.md b/README.md index 8cddaa4..20365d4 100644 --- a/README.md +++ b/README.md @@ -171,6 +171,7 @@ C4-PlantUML also comes with some layout options to make it easy and reuseable to * [LAYOUT_WITH_LEGEND()](LayoutOptions.md#layout_with_legend) * [LAYOUT_AS_SKETCH()](LayoutOptions.md#layout_as_sketch) * [HIDE_STEREOTYPE()](LayoutOptions.md#hide_stereotype) +* [AUTONUMBER_RELATIONSHIPS()](LayoutOptions.md#autonumber_relationships) ## Snippets for Visual Studio Code