From 016fcc92b269c60269df430a2dc5ca34f181ba95 Mon Sep 17 00:00:00 2001 From: Dirk Groot Date: Wed, 18 Jan 2023 09:35:44 +0100 Subject: [PATCH] Load themes when loading the Structurizr DSL workspace In #40, @simonbrowndotje let us know that themes need to be loaded separately. This fixes the issue of configured themes (using the `theme` and `themes` keywords) not being applied when generating diagrams. --- .../structurizr/site/generatr/CreateStructurizrWorkspace.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/nl/avisi/structurizr/site/generatr/CreateStructurizrWorkspace.kt b/src/main/kotlin/nl/avisi/structurizr/site/generatr/CreateStructurizrWorkspace.kt index c69a8b45..111d814c 100644 --- a/src/main/kotlin/nl/avisi/structurizr/site/generatr/CreateStructurizrWorkspace.kt +++ b/src/main/kotlin/nl/avisi/structurizr/site/generatr/CreateStructurizrWorkspace.kt @@ -1,8 +1,8 @@ package nl.avisi.structurizr.site.generatr import com.structurizr.dsl.StructurizrDslParser -import com.structurizr.export.plantuml.C4PlantUMLExporter import com.structurizr.model.Element +import com.structurizr.view.ThemeUtils import java.io.File fun createStructurizrWorkspace(workspaceFile: File) = @@ -10,6 +10,7 @@ fun createStructurizrWorkspace(workspaceFile: File) = .apply { parse(workspaceFile) } .workspace .apply { + ThemeUtils.loadThemes(this) model.elements.forEach { moveUrlToProperty(it) // We need the URL later for our own links, preserve the original in a property }