Skip to content

Commit

Permalink
Merge pull request plantuml-stdlib#216 from netrounds-fredrik/patch-1
Browse files Browse the repository at this point in the history
Make Container techn optional
  • Loading branch information
kirchsth committed Mar 21, 2022
2 parents ede252d + 2580861 commit 19da5d5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 27 deletions.
24 changes: 12 additions & 12 deletions C4_Component.puml
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ endlegend
' ##################################

!function $getComponent($label, $techn, $descr, $sprite)
!if ($descr == "") && ($sprite == "")
!return '=='+$label+'\n//<size:'+$TECHN_FONT_SIZE+'>['+$techn+']</size>//'
!endif
!if ($descr == "") && ($sprite != "")
!return $getSprite($sprite)+'\n=='+$label+'\n//<size:'+$TECHN_FONT_SIZE+'>['+$techn+']</size>//'
!endif
!if ($descr != "") && ($sprite == "")
!return '=='+$label+'\n//<size:'+$TECHN_FONT_SIZE+'>['+$techn+']</size>//\n\n '+$descr
!endif
!if ($descr != "") && ($sprite != "")
!return $getSprite($sprite)+'\n=='+$label+'\n//<size:'+$TECHN_FONT_SIZE+'>['+$techn+']</size>//\n\n '+$descr
!endif
!$component = ""
!if ($sprite != "")
!$component = $component + $getSprite($sprite) + '\n'
!endif
!$component = $component + '==' + $label
!if ($techn != "")
!$component = $component + '\n//<size:' + $TECHN_FONT_SIZE + '>[' + $techn + ']</size>//'
!endif
!if ($descr != "")
!$component = $component + '\n\n' + $descr
!endif
!return $component
!endfunction

!unquoted procedure Component($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Expand Down
24 changes: 12 additions & 12 deletions C4_Container.puml
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ endlegend
' ##################################

!function $getContainer($label, $techn, $descr, $sprite)
!if ($descr == "") && ($sprite == "")
!return '=='+$label+'\n//<size:'+$TECHN_FONT_SIZE+'>['+$techn+']</size>//'
!endif
!if ($descr == "") && ($sprite != "")
!return $getSprite($sprite)+'\n=='+$label+'\n//<size:'+$TECHN_FONT_SIZE+'>['+$techn+']</size>//'
!endif
!if ($descr != "") && ($sprite == "")
!return '=='+$label+'\n//<size:'+$TECHN_FONT_SIZE+'>['+$techn+']</size>//\n\n '+$descr
!endif
!if ($descr != "") && ($sprite != "")
!return $getSprite($sprite)+'\n=='+$label+'\n//<size:'+$TECHN_FONT_SIZE+'>['+$techn+']</size>//\n\n '+$descr
!endif
!$container = ""
!if ($sprite != "")
!$container = $container + $getSprite($sprite) + '\n'
!endif
!$container = $container + '==' + $label
!if ($techn != "")
!$container = $container + '\n//<size:' + $TECHN_FONT_SIZE + '>[' + $techn + ']</size>//'
!endif
!if ($descr != "")
!$container = $container + '\n\n' + $descr
!endif
!return $container
!endfunction

!unquoted procedure Container($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ SHOW_LEGEND()

> * `arg`.. argument required (e.g. `alias`)
> * `?arg`.. argument optional (e.g. `?descr`)
> * `*techn` .. technology argument is required, but if the technology is defined via $tags then no `techn` argument is required
* System Context & System Landscape diagrams
* Import: `!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml`
Expand All @@ -180,7 +179,7 @@ SHOW_LEGEND()
* Container diagram
* Import: `!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml`
* Additional Macros:
* `Container(alias, label, *techn, ?descr, ?sprite, ?tags, $link)`
* `Container(alias, label, ?techn, ?descr, ?sprite, ?tags, $link)`
* `ContainerDb`
* `ContainerQueue`
* `Container_Ext`
Expand All @@ -191,7 +190,7 @@ SHOW_LEGEND()
* Component diagram
* Import: `!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml`
* Additional Macros:
* `Component(alias, label, *techn, ?descr, ?sprite, ?tags, $link)`
* `Component(alias, label, ?techn, ?descr, ?sprite, ?tags, $link)`
* `ComponentDb`
* `ComponentQueue`
* `Component_Ext`
Expand Down

0 comments on commit 19da5d5

Please sign in to comment.