Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace diagrams with mermaid.js #188

Merged
merged 4 commits into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ stats
vm/*.ova
vm/mnt
trainer/
static/
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,21 @@ Start the presentation with the default settings:

More instructions [here](https://github.com/NETWAYS/training-global#using-docker-to-build-and-serve-the-slide-deck).

## Render mermaid.js

Many diagrams are rendered using [mermaid.js](https://mermaid.js.org/). The diagrams are stored in `*.mmd` files and are rendered using the mermaid-cli.

```
# Uses a containerized mermaid-cli to render all images
bash render-images.sh
```

To render a single image:

```
docker run -u `id -u`:`id -g` --rm -v $(pwd)/_images/mermaid:/data minlag/mermaid-cli -e png -i "/data/image-to-render.mmd"
```

### Environment

The training material focuses on https://nws.netways.de where every attendee
Expand All @@ -68,5 +83,3 @@ The rendered content will be updated at least if we do a newer version of the ma
will also be tagged on git.

Material is licensed under [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International](http://creativecommons.org/licenses/by-nc-sa/4.0/).


Binary file removed _images/ci/git_gitlab_ci_jobs.png
Binary file not shown.
Binary file removed _images/ci/git_jenkins_ci_git_hook.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed _images/introduction/git_introduction_cvcs_01.png
Binary file not shown.
Binary file removed _images/introduction/git_introduction_dvcs_01.png
Binary file not shown.
7 changes: 7 additions & 0 deletions _images/mermaid/central-vcs.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
graph RL
subgraph CentralVCS
C{{Version DB}}
end
C -->|Client A| D[File]
C -->|Client B| E[File]
C -->|Client C| F[File]
Binary file added _images/mermaid/central-vcs.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions _images/mermaid/decentral-vcs.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
graph RL
subgraph CentralVCS
C{{Version DB}}
end
C <--> A
C <--> B
subgraph ClientA
A{{VersionDB}}
end
subgraph ClientB
B{{VersionDB}}
end
Binary file added _images/mermaid/decentral-vcs.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions _images/mermaid/deltas.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
graph LR
version1 --> version2 --> version3 --> version4
A[File A] -->A1(Δ1) --> A2( ) --> A3(Δ2)
B[File B] -->B1( ) -->B2(Δ1) --> B3( )
C[File C] -->C1(Δ1) -->C2( ) --> C3(Δ2)
Binary file added _images/mermaid/deltas.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions _images/mermaid/git-stages.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sequenceDiagram
Working Directory->>+Staging Area: add
Staging Area->>+Repository: commit
Repository->>+Working Directory: checkout
Binary file added _images/mermaid/git-stages.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions _images/mermaid/workflow-after-rebase.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
gitGraph
commit id:"a11111"
commit id:"b22222"
commit id:"c33333"
commit id:"d44444"
branch local/main
checkout local/main
commit id:"y88888"
commit id:"z99999"
Binary file added _images/mermaid/workflow-after-rebase.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions _images/mermaid/workflow-before-rebase.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
gitGraph
commit id:"a11111"
commit id:"b22222"
branch local/main
checkout local/main
commit id:"y88888"
commit id:"z99999"
checkout main
commit id:"c33333"
commit id:"d44444"
Binary file added _images/mermaid/workflow-before-rebase.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions _images/mermaid/workflow-branches.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
gitGraph
commit
commit
branch fix/login-bug
checkout fix/login-bug
commit
commit
checkout main
commit
commit
branch feature/new-logo
checkout feature/new-logo
commit
Binary file added _images/mermaid/workflow-branches.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions _images/mermaid/workflow-diverge.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
gitGraph
commit
commit
branch local/main
checkout local/main
commit
commit
checkout main
commit
commit
Binary file added _images/mermaid/workflow-diverge.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions _images/mermaid/workflow-feature-branches.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
%%{init: { 'theme': 'default' , 'themeVariables': {
'git0': '#ff0000',
'git1': '#00ff00',
'git2': '#7171ff',
'git3': '#ff00ff',
'git4': '#00ffff',
'git5': '#ffff00',
'git6': '#ff00ff',
'git7': '#00ffff'
} } }%%
gitGraph
commit tag:"v0.1"
branch develop
checkout develop
commit
branch featureB
checkout featureB
commit
checkout main
checkout develop
commit
checkout featureB
commit
checkout main
commit tag:"v0.2"
checkout featureB
commit
checkout develop
branch featureA
commit
checkout develop
checkout featureA
commit
checkout featureB
commit
checkout develop
merge featureA
commit
checkout main
commit tag:"v1.0"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions _images/mermaid/workflow-github-pr.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
gitGraph
commit
commit
branch fork/of/repository
checkout fork/of/repository
commit
commit
commit type:HIGHLIGHT tag:"Pull Request"
checkout main
merge fork/of/repository
Binary file added _images/mermaid/workflow-github-pr.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions _images/mermaid/workflow-gitlab-mr.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
gitGraph
commit
commit
branch feature/branch
checkout feature/branch
commit
commit
commit type:HIGHLIGHT tag:"Merge Request"
checkout main
merge feature/branch
Binary file added _images/mermaid/workflow-gitlab-mr.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions _images/mermaid/workflow-historical-branches.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
%%{init: { 'theme': 'default' , 'themeVariables': {
'git0': '#ff0000',
'git1': '#00ff00',
'git2': '#7171ff',
'git3': '#ff00ff',
'git4': '#00ffff',
'git5': '#ffff00',
'git6': '#ff00ff',
'git7': '#00ffff'
} } }%%
gitGraph
commit tag:"v0.1"
branch develop
checkout develop
commit
checkout main
checkout develop
commit
checkout main
commit tag:"v0.2"
checkout develop
commit
checkout main
commit tag:"v1.0"
checkout develop
commit
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions _images/mermaid/workflow-local.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
gitGraph
commit id: "a11111"
commit id: "b22222"
commit id: "c33333" tag: "main"
Binary file added _images/mermaid/workflow-local.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions _images/mermaid/workflow-maintenance-branch.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
%%{init: { 'theme': 'default' , 'themeVariables': {
'git0': '#ff0000',
'git1': '#d0661c',
'git2': '#00ff00',
'git3': '#7171ff',
'git4': '#ff00ff',
'git5': '#00ffff',
'git6': '#ffff00',
'git7': '#ff00ff',
'git8': '#00ffff'
} } }%%
gitGraph
commit tag:"v0.1"
branch hotfix
checkout hotfix
commit
branch develop
checkout develop
commit
branch featureB
checkout featureB
commit
checkout main
checkout hotfix
commit
checkout develop
commit
checkout featureB
commit
checkout main
merge hotfix tag:"v0.2"
checkout featureB
commit
checkout develop
branch featureA
commit
checkout develop
merge hotfix
checkout featureA
commit
checkout featureB
commit
checkout develop
merge featureA
branch release
checkout release
commit
checkout main
commit tag:"v1.0"
checkout release
merge main
checkout develop
merge release
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions _images/mermaid/workflow-release-branches.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
%%{init: { 'theme': 'default' , 'themeVariables': {
'git0': '#ff0000',
'git1': '#00ff00',
'git2': '#7171ff',
'git3': '#ff00ff',
'git4': '#00ffff',
'git5': '#ffff00',
'git6': '#ff00ff',
'git7': '#00ffff'
} } }%%
gitGraph
commit tag:"v0.1"
branch develop
checkout develop
commit
branch featureB
checkout featureB
commit
checkout main
checkout develop
commit
checkout featureB
commit
checkout main
commit tag:"v0.2"
checkout featureB
commit
checkout develop
branch featureA
commit
checkout develop
checkout featureA
commit
checkout featureB
commit
checkout develop
merge featureA
branch release
checkout release
commit
checkout main
commit tag:"v1.0"
checkout release
merge main
checkout develop
merge release
Binary file added _images/mermaid/workflow-release-branches.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions _images/mermaid/workflow-remote.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gitGraph
commit id: "a11111"
commit id: "b22222"
commit id: "c33333"
commit id: "d44444" type: HIGHLIGHT
commit id: "e55555" type: HIGHLIGHT tag: "origin/main"
Binary file added _images/mermaid/workflow-remote.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed _images/workflows/git_centralized_workflow_01.png
Binary file not shown.
Binary file removed _images/workflows/git_centralized_workflow_02.png
Binary file not shown.
Binary file removed _images/workflows/git_centralized_workflow_03.png
Binary file not shown.
Diff not rendered.
Binary file removed _images/workflows/git_feature_branch_workflow_01.png
Diff not rendered.
Binary file removed _images/workflows/git_gitflow_workflow_02.png
Diff not rendered.
Binary file removed _images/workflows/git_gitflow_workflow_03.png
Diff not rendered.
Binary file removed _images/workflows/git_gitflow_workflow_04.png
Diff not rendered.
Binary file removed _images/workflows/git_gitflow_workflow_05.png
Diff not rendered.
Binary file removed _images/workflows/git_github_workflow.png
Diff not rendered.
Binary file removed _images/workflows/git_gitlab_workflow.png
Diff not rendered.
4 changes: 2 additions & 2 deletions day1/01_Introduction/01_Intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ systems which store the file revisions in a database.
* CVS, Subversion
* What happens if the server is down?

<center><img src="../../_images/introduction/git_introduction_cvcs_01.png" alt="CVCS"/></center>
<center><img src="../../_images/mermaid/central-vcs.mmd.png" alt="Central VCS"/></center>


~~~SECTION:handouts~~~
Expand All @@ -52,7 +52,7 @@ systems which store the file revisions in a database.
* Git, Mercurial, Bazaar, etc.
* Server dies, client continues

<center><img src="../../_images/introduction/git_introduction_dvcs_01.png" alt="CVCS"/></center>
<center><img src="../../_images/mermaid/decentral-vcs.mmd.png" alt="Decentral VCS"/></center>

~~~SECTION:handouts~~~
Expand Down
16 changes: 12 additions & 4 deletions day1/01_Introduction/03_Basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* Set of snapshots of a mini-filesystem
* No change - link to the previous identical stored file

<center><img src="../../_images/introduction/git_introduction_basics_01_changes.png" style="width:526px;height:305px;" alt="Basic Changes"/></center>
<center><img src="../../_images/mermaid/deltas.mmd.png" alt="Detla Changes"/></center>

!SLIDE smbullets printonly
# Snapshots and Differences
Expand All @@ -31,7 +31,7 @@
* Set of snapshots of a mini-filesystem
* No change - link to the previous identical stored file

<center><img src="../../_images/introduction/git_introduction_basics_01_changes.png" style="width:450px" alt="Basic Changes"/></center>
<center><img src="../../_images/mermaid/deltas.mmd.png" width="70%" alt="Detla Changes"/></center>


!SLIDE smbullets
Expand Down Expand Up @@ -62,15 +62,23 @@ Example:
~~~ENDSECTION~~~

!SLIDE smbullets
!SLIDE smbullets noprint
# The three states

* Working directory ("modified")
* Staging area ("staged")
* Git directory ("committed")

<center><img src="../../_images/introduction/git_introduction_basics_03_three_states.png" alt="Basics 3 States"/></center>
<center><img src="../../_images/mermaid/git-stages.mmd.png" alt="Git Stages"/></center>

!SLIDE smbullets printonly
# The three states

* Working directory ("modified")
* Staging area ("staged")
* Git directory ("committed")

<center><img src="../../_images/mermaid/git-stages.mmd.png" width="75%" alt="Git Stages"/></center>

~~~SECTION:notes~~~
Expand Down
Loading