Skip to content

Commit

Permalink
Add diagram smetana example (#245)
Browse files Browse the repository at this point in the history
* Add PlantUML UML diagram with Smetana engine works without Graphviz dot
PlantUML's Smetana engine supports a limited set of diagram types
out of the box without needing a Graphviz installation.
* Restore Graphviz install and document smetana usage
* Add '--no-progress' to choco install to reduce ci noise
* Bump asciidoctorj-diagram-plantuml & asciidoctorj-diagram-ditaamini version
---------

Co-authored-by: Alexander Kriegisch <[email protected]>
  • Loading branch information
abelsromero and kriegaex authored Feb 4, 2024
1 parent 52373cb commit c299e8a
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
run: sudo apt install graphviz
- name: Install Graphviz (Win)
if: matrix.os == 'windows-latest'
run: choco install graphviz
run: choco install graphviz --no-progress
- name: Install Graphviz (macOS)
if: matrix.os == 'macos-latest'
run: brew install graphviz
Expand Down
7 changes: 4 additions & 3 deletions asciidoctor-diagram-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj-diagram-plantuml</artifactId>
<version>1.2021.8</version>
<version>1.2023.12</version>
</dependency>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj-diagram-ditaamini</artifactId>
<version>1.0.0</version>
<version>1.0.3</version>
</dependency>
-->
</dependencies>
Expand All @@ -61,7 +61,8 @@
<require>asciidoctor-diagram</require>
</requires>
<attributes>
<!-- Example below shows how to specify in this pom instead of System's PATH, the location of dot command of Graphviz, required by PlantUML libraries -->
<!-- Example below shows how to specify in this pom instead of System's PATH, the location of dot command of Graphviz.
This is required by PlantUML libraries, unless 'smetana' is used https://plantuml.com/de/smetana02 -->
<!-- Windows:
<graphvizdot>C:\Program Files (x86)\Graphviz2.38\bin\dot.exe</graphvizdot>
-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,43 @@ Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
....

[graphviz, dot-example, svg]
[plantuml,aspectj-maven-multi-module]
....
@startuml
!pragma layout smetana
skinparam component {
BackgroundColor<<Using Aspects>> #EEEEFF
BorderColor<<Using Aspects>> black
}
node poms {
component "rootParentPOM"
component "aspectParentPOM"
[rootParentPOM] <|.. [aspectParentPOM]
}
node aspect_definition_projects {
component "validation-api"
component "validation-aspect"
[rootParentPOM] <|... [validation-api]
[rootParentPOM] <|.. [validation-aspect]
[validation-api] *-- [validation-aspect]
[validation-aspect] *-- [aspectParentPOM]
}
component "mavenProjectWithAspects"<<Using Aspects>>
[aspectParentPOM] <|.. [mavenProjectWithAspects]
@enduml
....

[plantuml, dot-example]
----
digraph g {
a -> b
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ void shouldGenerateHtmlWithDiagrams() {
.isDirectory()
.isDirectoryContaining(file -> file.getName().equals("asciidoctor-diagram-process.png"))
.isDirectoryContaining(file -> file.getName().equals("auth-protocol.png"))
.isDirectoryContaining(file -> file.getName().equals("dot-example.svg"));
.isDirectoryContaining(file -> file.getName().equals("dot-example.png"))
.isDirectoryContaining(file -> file.getName().equals("aspectj-maven-multi-module.png"));
}

private String generatedDocs(String filename) {
Expand Down

0 comments on commit c299e8a

Please sign in to comment.