This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/incubator-training.git


The following commit(s) were added to refs/heads/develop by this push:
     new 5f816f5  feat: Added support for mermaid diagrams (Probably only not 
working on Apple Silicon devices)
5f816f5 is described below

commit 5f816f51d76a27970a8d8efd3d6d7e682712e0b9
Author: Christofer Dutz <[email protected]>
AuthorDate: Tue Sep 17 22:06:22 2024 +0200

    feat: Added support for mermaid diagrams (Probably only not working on 
Apple Silicon devices)
---
 Dockerfile                                                  | 13 +++++++++----
 .../src/main/resources/archetype-resources/Dockerfile       | 13 +++++++++----
 .../archetype-resources/src/main/asciidoc/index.adoc        |  2 --
 3 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 83516ff..95f8d06 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -45,10 +45,10 @@ RUN python3 -m pip install --upgrade pip setuptools==57.5.0 
seqdiag blockdiag ac
 
 # Install vg2svg for rendering vega diagrams
 # NOTE: Installing vega-cli doesn't seem to work as dependencies are not 
available for arm64 (silicon)
-#ENV NODE_VERSION=18.20.4
-#RUN curl --silent -o- 
https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
-#RUN /root/.nvm/install.sh
-#ENV PATH=/root/.nvm/versions/node/v$NODE_VERSION/bin:$PATH
+ENV NODE_VERSION=18.20.4
+RUN curl --silent -o- 
https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
+RUN /root/.nvm/install.sh
+ENV PATH=/root/.nvm/versions/node/v$NODE_VERSION/bin:$PATH
 #RUN npm install --no-audit vega
 
 #RUN wget 
https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
@@ -69,6 +69,11 @@ RUN python3 -m pip install --upgrade pycairo pango syntrax
 # For some reason, if we install this before the python stuff, it doesn't work
 RUN apt install -y python3-gi-cairo
 
+# Install Mermaid
+# Mermaid seems to have issues with Apple Silicon
+#RUN apt install -y nodejs npm
+RUN npm install -g @mermaid-js/mermaid-cli
+
 # Required for running on Windows systems
 RUN apt install -y dos2unix
 
diff --git 
a/tools/content-archetype/src/main/resources/archetype-resources/Dockerfile 
b/tools/content-archetype/src/main/resources/archetype-resources/Dockerfile
index 83516ff..95f8d06 100644
--- a/tools/content-archetype/src/main/resources/archetype-resources/Dockerfile
+++ b/tools/content-archetype/src/main/resources/archetype-resources/Dockerfile
@@ -45,10 +45,10 @@ RUN python3 -m pip install --upgrade pip setuptools==57.5.0 
seqdiag blockdiag ac
 
 # Install vg2svg for rendering vega diagrams
 # NOTE: Installing vega-cli doesn't seem to work as dependencies are not 
available for arm64 (silicon)
-#ENV NODE_VERSION=18.20.4
-#RUN curl --silent -o- 
https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
-#RUN /root/.nvm/install.sh
-#ENV PATH=/root/.nvm/versions/node/v$NODE_VERSION/bin:$PATH
+ENV NODE_VERSION=18.20.4
+RUN curl --silent -o- 
https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
+RUN /root/.nvm/install.sh
+ENV PATH=/root/.nvm/versions/node/v$NODE_VERSION/bin:$PATH
 #RUN npm install --no-audit vega
 
 #RUN wget 
https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
@@ -69,6 +69,11 @@ RUN python3 -m pip install --upgrade pycairo pango syntrax
 # For some reason, if we install this before the python stuff, it doesn't work
 RUN apt install -y python3-gi-cairo
 
+# Install Mermaid
+# Mermaid seems to have issues with Apple Silicon
+#RUN apt install -y nodejs npm
+RUN npm install -g @mermaid-js/mermaid-cli
+
 # Required for running on Windows systems
 RUN apt install -y dos2unix
 
diff --git 
a/tools/content-archetype/src/main/resources/archetype-resources/src/main/asciidoc/index.adoc
 
b/tools/content-archetype/src/main/resources/archetype-resources/src/main/asciidoc/index.adoc
index 570ced7..58f3608 100644
--- 
a/tools/content-archetype/src/main/resources/archetype-resources/src/main/asciidoc/index.adoc
+++ 
b/tools/content-archetype/src/main/resources/archetype-resources/src/main/asciidoc/index.adoc
@@ -356,7 +356,6 @@ Person *--1 Location
 --
 --
 
-////
 === Mermaid: Flowchart
 
 mermaid::diagrams/mermaid-flowchart-test.mmd[png]
@@ -402,7 +401,6 @@ gantt
         Create tests for renderer           :2d
         Add to mermaid                      :1d
 ....
-////
 
 === SVGBob: Mindmap
 

Reply via email to