Skip to content
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

Support for structurizr workspace.json for layout information #1758

Open
tlanfer opened this issue Jun 17, 2024 · 4 comments
Open

Support for structurizr workspace.json for layout information #1758

tlanfer opened this issue Jun 17, 2024 · 4 comments

Comments

@tlanfer
Copy link

tlanfer commented Jun 17, 2024

We keep our architecture charts as a separate workspace.dsl file in a repository which we render via the mkdocs-kroki-plugin and then just reference it in different locations in our documentation as:

#  ContentRepositoryApp

```kroki-structurizr view-key=someSpecificView
@from_file:workspace.dsl
```

The automatic layouting is sometimes not ideal. Its easy enough to manually arange things to look good. Unfortunately it looks like there is no way to also provide the workspace.json file, which stores information on manually arranged view.

I considered if this a mkdocs-kroki-plugin limitation, but looking at the kroki docs it doesnt look like there is a way to provide more than one file to the render endpoints.

It would be great if it was possible.

@tlanfer
Copy link
Author

tlanfer commented Jun 17, 2024

Looking into alternative approaches to render these charts, i learned that none of the available structurizr exporters even support exporting manual layouting, which i guess makes this issue a bit wishfull thinking.

@asteven
Copy link

asteven commented Jul 16, 2024

export-diagrams.js from https://github.com/structurizr/puppeteer
allows you to render diagrams with custom layout.

I currently have a script that starts docker.io/structurizr/lite, then runs export-diagrams.js against that.
Works great.

Would off course be nicer if it would be integrated with kroki.

I see that kroki already uses puppeteer for other use cases, so I guess technically this would be possible.
But I don't know about the internals of kroki and how it interfaces with structurizr, so can not say how much work this would be to add or change.

@Heiss
Copy link
Contributor

Heiss commented Jul 16, 2024

I see that kroki already uses puppeteer for other use cases, so I guess technically this would be possible. But I don't know about the internals of kroki and how it interfaces with structurizr, so can not say how much work this would be to add or change.

Hey, i followed this issue... This was last year one thing i thought, when i came to wardleymapping and kroki... So i began to dig a little bit. It is not very difficult. I am using puppeteer as well as the diagrams.io implemenetation. So, feel free to copy and adjust it to your needs. :) https://github.com/yuzutech/kroki/blob/d97533eec6309c5a393dc4ce00cf2fc542cbcce3/onlinewardleymaps/src/index.js

In my case, i removed some stuff in the website of onlinewardleymaps.com to polish the output. So maybe something you need to do aswell.

@asteven
Copy link

asteven commented Jul 16, 2024

I don't have time to code this right now, but something like this might work (dumping here for future self or someone else):

  • run the docker.io/structurizr/onpremises as a container
  • for each request
  • when sending post requests to kroki, send the workspace.json file as "diagram_options"
  • possibly, when sending get requests encode both the workspace.dsl and the workspace.json file as one payload (url length may become a problem) and split them server side.

edit: actually, workspace.json contains workspace.dsl, and is what the api expects to get anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants