Skip to content

Commit 0852723

Browse files
Adds some docs for the Structurizr static site.
1 parent 3efcc30 commit 0852723

30 files changed

+64892
-22
lines changed

cli/70-building.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
layout: default
3+
title: Building from source
4+
parent: Structurizr CLI
5+
nav_order: 70
6+
permalink: /cli/building
7+
---
8+
9+
# Building from source
10+
11+
To build the Structurizr CLI from source, you'll need `git` and Java 17+ installed.
12+
The Structurizr UI is required for the CLI to export a static site,
13+
so you will need to additionally clone the [structurizr/ui](https://github.com/structurizr/ui) repo.
14+
15+
## Build
16+
17+
```
18+
git clone https://github.com/structurizr/cli.git structurizr-cli
19+
git clone https://github.com/structurizr/ui.git structurizr-ui
20+
cd structurizr-cli
21+
./ui.sh
22+
./gradlew clean build getDeps buildZip
23+
```
24+
25+
> To use early access/preview features, change the value of `PREVIEW_FEATURES` to `true` in the [Configuration](https://github.com/structurizr/cli/blob/master/src/main/java/com/structurizr/cli/Configuration.java) class.
26+
27+
If you see an error message of the form `Could not find com.structurizr:structurizr-dsl:x.y.z`, you will need to
28+
[build the Structurizr for Java repo from source, and publish to your local Maven repository](/java/building).
29+
30+
## Run
31+
32+
If successful, The `build/distributions` directory will contain a `structurizr-cli.zip` file.
33+
To run the Structurizr CLI, you can then:
34+
35+
1. Unzip into a directory of your choice.
36+
2. Add the directory to your operating system's path (optional).
37+
3. Use the `structurizr.sh` or `structurizr.bat` file as appropriate for your operating system.
38+
39+
Alternatively you can run the CLI directly from the build directory, with a command like the following:
40+
41+
```
42+
java -cp "build/libs/*:build/dependencies/*" com.structurizr.cli.StructurizrCliApplication
43+
```
44+
45+
## Docker
46+
47+
To build a Docker image:
48+
49+
```
50+
docker build . -t mytag
51+
```

cli/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: default
33
title: Structurizr CLI
4-
nav_order: 17
4+
nav_order: 18
55
has_children: true
66
permalink: /cli
77
has_toc: false

cli/installation.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,13 @@ permalink: /cli/installation
88

99
# Installation
1010

11-
## Building from source
12-
13-
To build this repo from the sources (you'll need `git` and Java 17+ installed):
14-
15-
```
16-
git clone https://github.com/structurizr/cli.git structurizr-cli
17-
cd structurizr-cli
18-
./gradlew
19-
```
20-
21-
If successful, The `build/distributions` directory will contain a `.zip` file, with which you can:
22-
23-
1. Unzip into a directory of your choice.
24-
2. Add the directory to your operating system's path (optional).
25-
3. Use the `structurizr.sh` or `structurizr.bat` file as appropriate for your operating system.
26-
27-
2811
## Local installation
2912

3013
1. Download the Structurizr CLI from [https://github.com/structurizr/cli/releases](https://github.com/structurizr/cli/releases), and unzip. You will need Java (version 17+) installed, and available to use from your command line.
3114
2. Unzip into a directory of your choice.
3215
3. Add the directory to your operating system's path (optional).
3316
4. Use the `structurizr.sh` or `structurizr.bat` file as appropriate for your operating system.
3417

35-
3618
## Docker
3719

3820
A prebuilt Docker image is available at [Docker Hub](https://hub.docker.com/r/structurizr/cli). To use it, for example:

contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: default
33
title: Contribute
4-
nav_order: 19
4+
nav_order: 20
55
permalink: /contribute
66
---
77

export/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: default
33
title: Exporters
4-
nav_order: 18
4+
nav_order: 19
55
has_children: true
66
permalink: /export
77
has_toc: false

static/01-generating.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
layout: default
3+
title: Generating a static site
4+
parent: Structurizr static site
5+
nav_order: 1
6+
permalink: /static/generating
7+
---
8+
9+
# Generating a static site
10+
11+
The following CLI commands can be used to generate a static site:
12+
13+
```
14+
./structurizr.sh export -format static -workspace workspace.dsl -output static
15+
./structurizr.sh export -format static -workspace workspace.json -output static
16+
```
17+
18+
## Workspace processing
19+
20+
The export command supports both JSON and DSL workspaces, and processes them in the same way:
21+
22+
- All documentation and decision records are removed from the workspace.
23+
- Graphviz automatic layout is run on all views that have automatic layout enabled.
24+
25+
The big difference between the JSON and DSL versions of the workspace is that the JSON version has layout information,
26+
whereas the DSL version doesn't. If you have authored your diagrams with manual layout via Structurizr Lite/on-premises/cloud,
27+
you will need to use the JSON version of the workspace. If you only use automatic layout, either version will suffice.

static/02-embed.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
layout: default
3+
title: Embedding diagrams
4+
parent: Structurizr static site
5+
nav_order: 2
6+
permalink: /static/embed
7+
---
8+
9+
# Embedding diagrams
10+
11+
Diagrams in the static site can be embedded via an iframe, with the following code:
12+
13+
```
14+
<iframe id="structurizrDiagram" src="index.html?iframe=structurizrDiagram#SystemContext" width="100%" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" allowfullscreen="true"></iframe>
15+
<script type="text/javascript" src="js/structurizr-embed.js"></script>
16+
```
17+
18+
- The window hash/anchor can be used to specify which diagram should be embedded.
19+
- This is a responsive embed, and requires that the `id` of the `iframe` matches the `iframe` parameter of the embed URL.
20+
21+
## Example
22+
23+
<div style="width: 100%">
24+
<iframe id="structurizrDiagram" src="/static/demo/index.html?iframe=structurizrDiagram#SystemContext" width="100%" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" allowfullscreen="true"></iframe>
25+
<script type="text/javascript" src="/static/demo/js/structurizr-embed.js"></script>
26+
</div>

static/demo/css/bootstrap-3.3.7.min.css

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)