structurizr / cli

A command line utility for Structurizr.
https://docs.structurizr.com/cli
Apache License 2.0
492 stars 75 forks source link

Allow export of Decisions & Documentation #153

Closed toorog closed 8 months ago

toorog commented 9 months ago

Description

As per today, the export command only allows exporting of views. However, the model specified by a DSL File also holds Decisions and Documentation Sections.

My proposal is to allow export of these assets via CLI as well. The possible command might look like this:

Since multiple elements can contain Decisions and / or Doc sections, I propose to make use of the hierarchical identifier to create the subdirectory structure in out_directory.

Priority

I'm willing to add this feature myself and raise a PR (please confirm approach first)

More information

No response

simonbrowndotje commented 9 months ago

Exporting documentation and decisions is much more work than it seems, particularly when you start thinking about how to render embedded diagrams (both views defined within the workspace, and external diagrams from PlantUML, Mermaid, etc) and also things like links between documentation sections and decisions. You might want to take a look at Structurizr Site Generatr that provides some of this functionality already.

toorog commented 9 months ago

I was not talking about any rendering. I was only referring to a 1:1 dump of the files that are embedded in the model (ADRs, Decisions).

simonbrowndotje commented 9 months ago

I'm not sure I see a use case for such a feature ... why can't you just use the original source files that are referenced by the DSL?

toorog commented 9 months ago

I am using a pipeline that produces a workspace.json based on DSL files and ADRs + Documentation. The output of the pipeline is a "documentation release".

There are several other pipelines as well, that solely depend on the released workspace.json as input, and produce various documents / formats as output. e.g.

e.g. I want to now add a pipeline, that uses asciidoctor to render a PDF of the ARC42 documents contained in the model. The pipeline would be:

  1. Download most recent released workspace.json
  2. Dump all files contained in the json <-- This is what is missing in structurizr-cli
  3. Use asciidoctor to generate PDF
simonbrowndotje commented 8 months ago

Closing as not planned ... I'd recommend building your own custom utility to do this instead.