Skip to content

Commit

Permalink
[#674] Make mermaid-generated images available to webapp
Browse files Browse the repository at this point in the history
  • Loading branch information
mengdaming committed Oct 1, 2024
1 parent dd4d015 commit 317c654
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 13 deletions.
10 changes: 0 additions & 10 deletions variants-doc/generate_png.bash

This file was deleted.

14 changes: 14 additions & 0 deletions variants-doc/mmd/generate_png.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

echo "Installing mermaid-cli"
npm update -g @mermaid-js/mermaid-cli || echo "Failed to install mermaid-cli. Aborting"

repo_root_dir="$(git rev-parse --show-toplevel)"
webapp_images_dir="${repo_root_dir}/webapp/src/assets/images"

echo "Generating files into ${webapp_images_dir}"
for mmd_file in ./*.mmd; do
png_file="${mmd_file%.mmd}.png"
echo "- Generating ${png_file} from ${mmd_file}"
mmdc --input "${mmd_file}" --output "${webapp_images_dir}/${png_file}" --theme dark --backgroundColor transparent
done
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions variants-doc/tcr_variants.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ The state diagrams below summarize the behavior of each variant.
tcr --variant=original
```

![TCR Original variant](./variant-original.png)
![TCR Original variant](../webapp/src/assets/images/variant-original.png)

## BTCR - Build && Test && Commit || Revert

```shell
tcr --variant=btcr
```

![TCR BTCR variant](./variant-btcr.png)
![TCR BTCR variant](../webapp/src/assets/images/variant-btcr.png)

## The Relaxed

Expand All @@ -42,4 +42,4 @@ tcr --variant=relaxed

The above option `--variant=relaxed` may be omitted as this is the default variant.

![TCR Relaxed variant](./variant-relaxed.png)
![TCR Relaxed variant](../webapp/src/assets/images/variant-relaxed.png)
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit 317c654

Please sign in to comment.