PlantUML Settings

Usage

Set in puml file’s header
!include https://raw.githubusercontent.com/attilasomogyi/plantuml-settings/main/src/plantuml-settings.puml

PlantUML Application’s documentation

Date function

Date function return ISO 8601 format yyyy-MM-dd date value.

examples/plantuml-settings.puml 3-6 lines
!function $date()
!$date = %date("yyyy-MM-dd")
!return $date
!endfunction

Title function

Title function return with file name without file extension.

examples/plantuml-settings.puml 8-16 lines
!function $title()
!$title = %filename()
!$title_length = %strlen("$title")
!$title_extension_start = %strpos($title, ".pu")
!if ($title_extension_start > 0)
!$title = %substr($title, 0, $title_extension_start)
!endif
!return $title
!endfunction

Image settings

examples/plantuml-settings.puml 18-26 lines
scale 0.7
skinparam Dpi 300
skinparam Shadowing true
skinparam monochrome true
skinparam BackgroundColor White
skinparam RoundCorner 5
skinparam ParticipantPadding 40
skinparam BoxPadding 10
skinparam Padding 10

Font settings

examples/plantuml-settings.puml 28-33 lines
skinparam Default {
    FontName Arial
    FontColor black
    FontSize 12
    TextAlignment center
}

Set caption size

examples/plantuml-settings.puml 35-37 lines
skinparam Caption {
    FontSize 16
}

Set standard UML class diagram appearance

examples/plantuml-settings.puml 39-41 lines
skinparam Class {
    AttributeIconSize 0
}

Full source code

examples/plantuml-settings.puml
@startuml

!function $date()
!$date = %date("yyyy-MM-dd")
!return $date
!endfunction

!function $title()
!$title = %filename()
!$title_length = %strlen("$title")
!$title_extension_start = %strpos($title, ".pu")
!if ($title_extension_start > 0)
!$title = %substr($title, 0, $title_extension_start)
!endif
!return $title
!endfunction

scale 0.7
skinparam Dpi 300
skinparam Shadowing true
skinparam monochrome true
skinparam BackgroundColor White
skinparam RoundCorner 5
skinparam ParticipantPadding 40
skinparam BoxPadding 10
skinparam Padding 10

skinparam Default {
    FontName Arial
    FontColor black
    FontSize 12
    TextAlignment center
}

skinparam Caption {
    FontSize 16
}

skinparam Class {
    AttributeIconSize 0
}

title $title()
footer Updated on $date()

@enduml