This is an automated email from the ASF dual-hosted git repository.
bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git
The following commit(s) were added to refs/heads/master by this push:
new 48f05af More info and examples
48f05af is described below
commit 48f05afb7c2928beb1dd63a66f7a7f20855f7bbd
Author: Bertrand Delacretaz <[email protected]>
AuthorDate: Mon Aug 31 16:34:05 2020 +0200
More info and examples
---
asciidoctor-diagrams/README.md | 30 ++--
.../generated-diagrams/auth-protocol-plantuml.png | Bin 7121 -> 11247 bytes
.../docs/generated-diagrams/bob-alice-again.png | Bin 7414 -> 0 bytes
.../docs/generated-diagrams/plantuml-network.png | Bin 0 -> 5330 bytes
.../docs/generated-diagrams/plantuml-sprites.png | Bin 0 -> 8208 bytes
.../generated-diagrams/plantuml-with-icons.png | Bin 0 -> 7085 bytes
.../src/main/asciidoc/more-diagrams.adoc | 161 ++++++++++++++++++++-
.../src/main/asciidoc/some-diagrams.adoc | 8 +
8 files changed, 182 insertions(+), 17 deletions(-)
diff --git a/asciidoctor-diagrams/README.md b/asciidoctor-diagrams/README.md
index b8fb4c2..3f99b11 100644
--- a/asciidoctor-diagrams/README.md
+++ b/asciidoctor-diagrams/README.md
@@ -1,5 +1,4 @@
-Using Asciidoctor Diagram in Maven projects
-====
+# Using Asciidoctor Diagram in Maven projects
This is an example of how to use [Asciidoctor
Diagram](https://asciidoctor.org/docs/asciidoctor-diagram/) to
generate diagrams in Maven projects and include them
@@ -22,8 +21,7 @@ In this example project, the Asciidoctor Maven Plugin runs on
every build as the
Maven profile is enabled by default. Depending on the diagram generators used,
running the plugin might
change the generated images every time, which is not convenient.
-Usage scenario
-----
+## Usage scenario
The idea is to store the diagrams under `src/docs/asciidoc` and have the
[Asciidoctor Maven
Plugin](https://asciidoctor.org/docs/asciidoctor-maven-plugin/) convert them
and store the results under `src/docs/generated-diagrams`, so the generated
images can be committed to be used in README and other
Markdown files.
@@ -31,27 +29,35 @@ Markdown files.
Here are example diagrams generated by the asciidoc documents found under
`src/docs/asciidoc`
in this project.
-### Out-of-the box tools
+## Out-of-the box tools
The following diagram generation tools should work on a standard Maven setup.
-#### ditaa diagram
+### ditaa diagram
+
+Ditaa converts ASCII art diagrams to (much) nicer graphics.
See http://ditaa.sourceforge.net/#usage for usage information.

-#### PlantUML diagram
+### PlantUML diagram
+PlantUML supports lots of diagram types: sequence, use case, class, activity,
component,
+state, object, deployment, timing, network, wireframe and more.
See https://plantuml.com and
https://crashedmind.github.io/PlantUMLHitchhikersGuide/

-#### PlantUML diagram from a different source file
+### PlantUML network diagram
+
+
+
+### PlantUML diagram using sprites
-
+
-### Tools that must be installed separately
+## Tools that must be installed separately
The following diagram generation tools must be installed separately to be
available
at build time. If they are missing, the Maven plugin outputs descriptive
@@ -60,13 +66,13 @@ error messages but does not fail the build.
The `more-syntaxes.adoc` document has more examples in various syntaxes,
most or all fail to build unless you have installed the required tools.
-#### GraphViz diagram
+### GraphViz diagram
This one requires the `dot` command of [Graphviz](https://graphviz.org/)
to be available at build time.

-#### Vega diagram
+### Vega diagram
[Vega](https://vega.github.io) can be installed with `npm install -g vega-cli`
so
that might be a reasonable option if we need more complex diagrams.
diff --git
a/asciidoctor-diagrams/src/docs/generated-diagrams/auth-protocol-plantuml.png
b/asciidoctor-diagrams/src/docs/generated-diagrams/auth-protocol-plantuml.png
index 864f406..0995068 100644
Binary files
a/asciidoctor-diagrams/src/docs/generated-diagrams/auth-protocol-plantuml.png
and
b/asciidoctor-diagrams/src/docs/generated-diagrams/auth-protocol-plantuml.png
differ
diff --git
a/asciidoctor-diagrams/src/docs/generated-diagrams/bob-alice-again.png
b/asciidoctor-diagrams/src/docs/generated-diagrams/bob-alice-again.png
deleted file mode 100644
index 9ac3ca0..0000000
Binary files
a/asciidoctor-diagrams/src/docs/generated-diagrams/bob-alice-again.png and
/dev/null differ
diff --git
a/asciidoctor-diagrams/src/docs/generated-diagrams/plantuml-network.png
b/asciidoctor-diagrams/src/docs/generated-diagrams/plantuml-network.png
new file mode 100644
index 0000000..70b15b8
Binary files /dev/null and
b/asciidoctor-diagrams/src/docs/generated-diagrams/plantuml-network.png differ
diff --git
a/asciidoctor-diagrams/src/docs/generated-diagrams/plantuml-sprites.png
b/asciidoctor-diagrams/src/docs/generated-diagrams/plantuml-sprites.png
new file mode 100644
index 0000000..20abb31
Binary files /dev/null and
b/asciidoctor-diagrams/src/docs/generated-diagrams/plantuml-sprites.png differ
diff --git
a/asciidoctor-diagrams/src/docs/generated-diagrams/plantuml-with-icons.png
b/asciidoctor-diagrams/src/docs/generated-diagrams/plantuml-with-icons.png
new file mode 100644
index 0000000..afec896
Binary files /dev/null and
b/asciidoctor-diagrams/src/docs/generated-diagrams/plantuml-with-icons.png
differ
diff --git a/asciidoctor-diagrams/src/main/asciidoc/more-diagrams.adoc
b/asciidoctor-diagrams/src/main/asciidoc/more-diagrams.adoc
index 79cf159..da7efe4 100644
--- a/asciidoctor-diagrams/src/main/asciidoc/more-diagrams.adoc
+++ b/asciidoctor-diagrams/src/main/asciidoc/more-diagrams.adoc
@@ -8,13 +8,164 @@ digraph g {
}
----
-[plantuml,bob-alice-again]
+[plantuml,plantuml-network]
....
-Aliss -> Bop: Yo, Bop?
-Bop --> Aliss: Yo Aliss what's up?
+@startuml
+nwdiag {
+ network dmz {
+ address = "210.x.x.x/24"
-Aliss -> Bop: TBH, TVB
-Aliss <-- Bop: Ok, good on you!
+ web01 [address = "210.x.x.1"];
+ web02 [address = "210.x.x.2"];
+ }
+ network internal {
+ address = "172.x.x.x/24";
+
+ web01 [address = "172.x.x.1"];
+ web02 [address = "172.x.x.2"];
+ db01;
+ db02;
+ }
+}
+@enduml
+....
+
+[plantuml,plantuml-sprites]
+....
+@startuml
+sprite $C4person100Small [16x16/16] {
+0000004774000000
+0000067777600000
+0000377777720000
+0000477777740000
+0000377777730000
+0000077777600000
+0244467777644420
+3777777777777773
+6777777777777776
+7777777777777777
+7777777777777777
+7777777777777777
+7777777777777777
+7777777777777777
+5777777777777774
+0477777777777640
+}
+
+sprite $C4person100Big [100x100/16] {
+0000000000000000000000000000000000000000000013456666543100000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000014677777777777764100000000000000000000000000000000000000000
+0000000000000000000000000000000000000002577777777777777777751000000000000000000000000000000000000000
+0000000000000000000000000000000000000157777777777777777777777400000000000000000000000000000000000000
+0000000000000000000000000000000000003777777777777777777777777772000000000000000000000000000000000000
+0000000000000000000000000000000000047777777777777777777777777777300000000000000000000000000000000000
+0000000000000000000000000000000000577777777777777777777777777777740000000000000000000000000000000000
+0000000000000000000000000000000005777777777777777777777777777777773000000000000000000000000000000000
+0000000000000000000000000000000047777777777777777777777777777777777300000000000000000000000000000000
+0000000000000000000000000000000277777777777777777777777777777777777710000000000000000000000000000000
+0000000000000000000000000000000677777777777777777777777777777777777760000000000000000000000000000000
+0000000000000000000000000000004777777777777777777777777777777777777773000000000000000000000000000000
+0000000000000000000000000000017777777777777777777777777777777777777776000000000000000000000000000000
+0000000000000000000000000000047777777777777777777777777777777777777777300000000000000000000000000000
+0000000000000000000000000000077777777777777777777777777777777777777777600000000000000000000000000000
+0000000000000000000000000000277777777777777777777777777777777777777777710000000000000000000000000000
+0000000000000000000000000000577777777777777777777777777777777777777777730000000000000000000000000000
+0000000000000000000000000000677777777777777777777777777777777777777777750000000000000000000000000000
+0000000000000000000000000000777777777777777777777777777777777777777777770000000000000000000000000000
+0000000000000000000000000001777777777777777777777777777777777777777777770000000000000000000000000000
+0000000000000000000000000002777777777777777777777777777777777777777777771000000000000000000000000000
+0000000000000000000000000003777777777777777777777777777777777777777777771000000000000000000000000000
+0000000000000000000000000003777777777777777777777777777777777777777777772000000000000000000000000000
+0000000000000000000000000003777777777777777777777777777777777777777777771000000000000000000000000000
+0000000000000000000000000002777777777777777777777777777777777777777777771000000000000000000000000000
+0000000000000000000000000001777777777777777777777777777777777777777777770000000000000000000000000000
+0000000000000000000000000000777777777777777777777777777777777777777777760000000000000000000000000000
+0000000000000000000000000000677777777777777777777777777777777777777777750000000000000000000000000000
+0000000000000000000000000000477777777777777777777777777777777777777777730000000000000000000000000000
+0000000000000000000000000000277777777777777777777777777777777777777777710000000000000000000000000000
+0000000000000000000000000000077777777777777777777777777777777777777777600000000000000000000000000000
+0000000000000000000000000000047777777777777777777777777777777777777777200000000000000000000000000000
+0000000000000000000000000000007777777777777777777777777777777777777776000000000000000000000000000000
+0000000000000000000000000000003777777777777777777777777777777777777772000000000000000000000000000000
+0000000000000000000000000000000677777777777777777777777777777777777750000000000000000000000000000000
+0000000000000000000000000000000177777777777777777777777777777777777710000000000000000000000000000000
+0000000000000000000000000000000037777777777777777777777777777777777200000000000000000000000000000000
+0000000000000000000000000000000004777777777777777777777777777777773000000000000000000000000000000000
+0000000000000000000000000000000000477777777777777777777777777777730000000000000000000000000000000000
+0000000000000000001111111111111111157777777777777777777777777777411111111111111111000000000000000000
+0000000000002456777777777777777777777777777777777777777777777777777777777777777777776531000000000000
+0000000001577777777777777777777777777777777777777777777777777777777777777777777777777777741000000000
+0000000157777777777777777777777777777777777777777777777777777777777777777777777777777777777510000000
+0000003777777777777777777777777777777777777777777777777777777777777777777777777777777777777772000000
+0000047777777777777777777777777777777777777777777777777777777777777777777777777777777777777777300000
+0000477777777777777777777777777777777777777777777777777777777777777777777777777777777777777777730000
+0003777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777772000
+0017777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777776000
+0057777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777400
+0177777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777700
+0477777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777730
+0677777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777760
+1777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777770
+3777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777772
+5777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777773
+6777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777775
+6777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777775
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777776
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777776
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777776
+7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777776
+6777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777775
+6777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777774
+4777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777773
+3777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777771
+1777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777770
+0677777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777750
+0377777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777720
+0077777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777600
+0047777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777200
+0006777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777775000
+0001777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777771000
+0000277777777777777777777777777777777777777777777777777777777777777777777777777777777777777777710000
+0000027777777777777777777777777777777777777777777777777777777777777777777777777777777777777777100000
+0000001677777777777777777777777777777777777777777777777777777777777777777777777777777777777750000000
+0000000036777777777777777777777777777777777777777777777777777777777777777777777777777777776200000000
+0000000000257777777777777777777777777777777777777777777777777777777777777777777777777776420000000000
+0000000000000134566666666666666666666666666666666666666666666666666666666666666666554210000000000000
+}
+
+!function $increment($value, $howMuch=1)
+!return $value + $howMuch
+!endfunction
+
+Bob : <$C4person100Small> Small
+Alice : <$C4person100Big> Big
+
+Alice -> Bob : Sending $increment(3)
+Alice <- Bob : Returning $increment(5, 3)
+
+@enduml
....
[vega,vega-example]
diff --git a/asciidoctor-diagrams/src/main/asciidoc/some-diagrams.adoc
b/asciidoctor-diagrams/src/main/asciidoc/some-diagrams.adoc
index 8d6f15d..9f5485d 100644
--- a/asciidoctor-diagrams/src/main/asciidoc/some-diagrams.adoc
+++ b/asciidoctor-diagrams/src/main/asciidoc/some-diagrams.adoc
@@ -20,6 +20,14 @@
[plantuml,auth-protocol-plantuml]
....
+skinparam roundcorner 20
+skinparam sequence {
+ BackgroundColor PaleGreen
+ ArrowColor SeaGreen
+ BorderColor SpringGreen
+}
+
+actor Bob #blue
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response