The library provides 13 packages.
- aws-q2-2024
- azure-19
- c4model
- c4nord
- c4k8s
- domainstorytelling
- eip-1
- eventstorming
- fontawesome-6
- gcp
- homecloud-2
- material-4
- simpleicons-8
Include remotely the library:
@startuml
' configures the library
!global $LIB_BASE_LOCATION="https://raw.githubusercontent.com/tmorin/plantuml-libs/master/distribution"
' loads the library
!include $LIB_BASE_LOCATION/bootstrap.puml
@enduml
Include locally the library:
@startuml
' configures the library
!global $INCLUSION_MODE="local"
!global $LIB_BASE_LOCATION="<the relative path to the /distribution directory>"
' loads the library
!include $LIB_BASE_LOCATION/bootstrap.puml
@enduml
When documenting large projects, it's often a good practice to define the components in separate .puml
files which will be then included in other .puml
files containing the diagrams to render.
So that, the component definitions can be re-used among the diagrams.
However, be careful about relative and absolute paths with the usage of !include
(the native PlantUML directive) vs include()
(a custom procedure provided in this library).
According to where you are (i.e. reference files vs diagram files), the relative paths won't be resolved from the current directory.
Given the following file tree, the following snippets should help you to configure files properly.
- project/
- ref/
- c4.puml
- aws.puml
- src/
- guidebook/
- component/
- c4.puml
- aws.puml
- component/
- guidebook/
- ref/
!global $INCLUSION_MODE="local"
!global $LIB_BASE_LOCATION="../node_modules/@tmorin/plantuml-libs/distribution"
!include $LIB_BASE_LOCATION/bootstrap.puml
include('c4model/bootstrap')
' definition of the common elements below
' .....
!global $INCLUSION_MODE="local"
!global $LIB_BASE_LOCATION="../node_modules/@tmorin/plantuml-libs/distribution"
!include $LIB_BASE_LOCATION/bootstrap.puml
include('aws-20200911/bootstrap')
' definition of the common elements below
' .....
@startuml level1-system
!include ../../../ref/c4.puml
!global $IMAGE_BASE_PATH="../../" + $LIB_BASE_LOCATION + "/"
!global $LIB_BASE_LOCATION="../../" + $LIB_BASE_LOCATION
' description of the diagram below
' .....
@enduml
@startuml infrastructure-production
!include ../../../ref/aws.puml
!global $IMAGE_BASE_PATH="../../" + $LIB_BASE_LOCATION + "/"
!global $LIB_BASE_LOCATION="../../" + $LIB_BASE_LOCATION
' description of the diagram below
' .....
@enduml
' loads the AwsDataExchange element from the aws-20200911 package
include('aws-20200911/Service/Analytics/AwsDataExchange')
The title of the diagram can be formatted using the procedure:
Title("the title of the diagram", "an optional subtitle", "an optioanl version", "an optional date")
The relationships' texts between the diagram's items can be formatted using the procedure:
Relationship("an expected reason of the relationship", "an optional technology")