-
Notifications
You must be signed in to change notification settings - Fork 36
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
Issue adding icons to styles in 1.1.7 #363
Comments
Interesting. Does this really no longer reproduce by completely removing the cache? diff --git a/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/DiagramGenerator.kt b/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/DiagramGenerator.kt
index 83e13e5..01ab573 100644
--- a/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/DiagramGenerator.kt
+++ b/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/DiagramGenerator.kt
@@ -43,15 +43,11 @@ fun generateDiagramWithElementLinks(
diagramCache: ConcurrentHashMap<String, String>
): String {
val diagram = generatePlantUMLDiagramWithElementLinks(workspace, view, url)
+ val reader = SourceStringReader(diagram.withCachedIncludes().definition)
+ val stream = ByteArrayOutputStream()
- val name = "${diagram.key}-${view.key}"
- return diagramCache.getOrPut(name) {
- val reader = SourceStringReader(diagram.withCachedIncludes().definition)
- val stream = ByteArrayOutputStream()
-
- reader.outputImage(stream, FileFormatOption(FileFormat.SVG, false))
- stream.toString(Charsets.UTF_8)
- }
+ reader.outputImage(stream, FileFormatOption(FileFormat.SVG, false))
+ stream.toString(Charsets.UTF_8)
}
private fun generatePlantUMLDiagrams(workspace: Workspace): Collection<Diagram> { |
Hi @qtzar I've looked again briefly at the code, but couldn't see anything obvious. Do you happen to have a public repo with a minimal setup where that issue can be seen? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In our workspace we have setup a number of styles similar to the following where the 'icons' folder exists in the same directory as the workspace folder.
In 1.1.4 our diagrams would be generated correctly and the icons would show on the elements that had the appropriate tag however in the newer version the icons are no longer appearing when the site is generated from a GitHub repository, but they still work fine from a locally generated site or when you use a local serve.
I believe that the new caching feature caused a small change where the working directory is no longer the directory the workspace.dsl file is and thus the diagram generator is not able to find that icons directory any more.
The text was updated successfully, but these errors were encountered: