Skip to content

Support of "all" PlantUML elements can be enabled #337

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions C4.puml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
' C4-PlantUML

' Global pre-settings
' ##################################
' ENABLE_ALL_PLANT_ELEMENTS
' If ENABLE_ALL_PLANT_ELEMENTS is set BEFORE the first C4_* file is loaded, nearly "all" PlantUML elements can be used like
' Component(StorageA, "Storage A ", $baseShape="storage")
' ENABLE_ALL_PLANT_ELEMENTS can be set via
' !ENABLE_ALL_PLANT_ELEMENTS = 1
' or with additional command line argument -DENABLE_ALL_PLANT_ELEMENTS=1

'Version
' ##################################
!function C4Version()
Expand Down Expand Up @@ -159,6 +168,66 @@ skinparam actor {
style awesome
}

!if %variable_exists("ENABLE_ALL_PLANT_ELEMENTS")
skinparam agent {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam artifact {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam boundary {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam card {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam circle {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam cloud {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam collections {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam control {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam entity {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam file {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam folder {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam frame {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam hexagon {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam interface {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam label {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam stack {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam storage {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam usecase {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam person {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
!endif

' Some boundary skinparams have to be set as package skinparams too (PlantUML uses internal packages)
' UpdateBoundaryStyle() called in boundary section below
skinparam rectangle<<boundary>> {
Expand Down Expand Up @@ -378,6 +447,29 @@ skinparam package {
!$tagSkin = $tagSkin + "skinparam package<<" + $tagStereo + ">>StereotypeFontColor " + $bgColor + %newline()
!$tagSkin = $tagSkin + "skinparam rectangle<<" + $tagStereo + ">>StereotypeFontColor " + $bgColor + %newline()
!endif
!if %variable_exists("ENABLE_ALL_PLANT_ELEMENTS")
!$tagSkin = $tagSkin + $elementTagSkinparams("agent", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("artifact", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("card", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("cloud", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("collections", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("file", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("folder", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("frame", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("hexagon", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("package", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("stack", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("storage", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("usecase", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
' elements without background: font uses $bgColor
!$tagSkin = $tagSkin + $elementTagSkinparams("boundary", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("circle", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("control", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("entity", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("interface", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
' label uses wrong font color? (should be $bgColor too)
!$tagSkin = $tagSkin + $elementTagSkinparams("label", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!endif
$tagSkin
!endprocedure

Expand Down
8 changes: 4 additions & 4 deletions C4_Component.puml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ endlegend
' Elements
' ##################################

!unquoted procedure Component($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
$getElementLine("rectangle", "component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!unquoted procedure Component($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle")
$getElementLine($baseShape, "component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ComponentDb($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Expand All @@ -70,8 +70,8 @@ endlegend
$getElementLine("queue", "component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure Component_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
$getElementLine("rectangle", "external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!unquoted procedure Component_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle")
$getElementLine($baseShape, "external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ComponentDb_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Expand Down
8 changes: 4 additions & 4 deletions C4_Container.puml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ endlegend
' Elements
' ##################################

!unquoted procedure Container($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
$getElementLine("rectangle", "container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!unquoted procedure Container($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle")
$getElementLine($baseShape , "container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ContainerDb($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Expand All @@ -77,8 +77,8 @@ endlegend
$getElementLine("queue", "container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure Container_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
$getElementLine("rectangle", "external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!unquoted procedure Container_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle")
$getElementLine($baseShape , "external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ContainerDb_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Expand Down
8 changes: 4 additions & 4 deletions C4_Context.puml
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,9 @@ rectangle "$getPerson($label, $type, $descr, $sprite)$getProps()" $toStereos("ex
!endif
!endprocedure

!unquoted procedure System($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!unquoted procedure System($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="", $baseShape="rectangle")
' $type reuses $techn definition of $tags
$getElementLine("rectangle", "system", $alias, $label, $type, $descr, $sprite, $tags, $link)
$getElementLine($baseShape, "system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure SystemDb($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
Expand All @@ -395,9 +395,9 @@ rectangle "$getPerson($label, $type, $descr, $sprite)$getProps()" $toStereos("ex
$getElementLine("queue", "system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure System_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!unquoted procedure System_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="", $baseShape="rectangle")
' $type reuses $techn definition of $tags
$getElementLine("rectangle", "external_system", $alias, $label, $type, $descr, $sprite, $tags, $link)
$getElementLine($baseShape , "external_system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure SystemDb_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
Expand Down
12 changes: 6 additions & 6 deletions C4_Sequence.puml
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ $calcDescr
$getParticipant("external_person", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure System($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!unquoted procedure System($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="", $baseShape="rectangle")
' $type reuses $techn definition of $tags
$getParticipant("system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure
Expand All @@ -247,7 +247,7 @@ $calcDescr
$getParticipant("system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure System_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!unquoted procedure System_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="", $baseShape="rectangle")
' $type reuses $techn definition of $tags
$getParticipant("external_system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure
Expand All @@ -264,7 +264,7 @@ $calcDescr



!unquoted procedure Container($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!unquoted procedure Container($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle")
$getParticipant("container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

Expand All @@ -276,7 +276,7 @@ $calcDescr
$getParticipant("container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure Container_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!unquoted procedure Container_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle")
$getParticipant("external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

Expand All @@ -290,7 +290,7 @@ $calcDescr



!unquoted procedure Component($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!unquoted procedure Component($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle")
$getParticipant("component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

Expand All @@ -302,7 +302,7 @@ $calcDescr
$getParticipant("component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure Component_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!unquoted procedure Component_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle")
$getParticipant("external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

Expand Down
Loading