Skip to content

Commit c126f9a

Browse files
rr
1 parent 7104a33 commit c126f9a

File tree

2 files changed

+43
-3
lines changed

2 files changed

+43
-3
lines changed

.github/workflows/sync-wiki.yml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
4848
# Process image references line by line for more reliable detection
4949
while IFS= read -r line; do
50-
# Fix the regex syntax for bash
50+
# Check for Markdown style image references
5151
if [[ "$line" =~ !\[(.*)\]\((.*)\) ]]; then
5252
img_path="${BASH_REMATCH[2]}"
5353
@@ -56,7 +56,7 @@ jobs:
5656
continue
5757
fi
5858
59-
# Determine the absolute path of the image
59+
# Handle Markdown image syntax
6060
if [[ $img_path == /* ]]; then
6161
# Absolute path within repository
6262
abs_img_path="./$img_path"
@@ -87,6 +87,46 @@ jobs:
8787
echo "Files in $base_dir:"
8888
ls -la "$base_dir"
8989
fi
90+
# Check for HTML style image tags - look for <img tags and extract src attribute
91+
elif [[ "$line" =~ \<img[[:space:]][^>]*src=\"([^\"]+)\"[^>]*\> ]]; then
92+
img_path="${BASH_REMATCH[1]}"
93+
94+
# Skip URLs
95+
if [[ $img_path == http* ]]; then
96+
continue
97+
fi
98+
99+
# Determine the absolute path of the image
100+
if [[ $img_path == /* ]]; then
101+
# Absolute path within repository
102+
abs_img_path="./$img_path"
103+
else
104+
# Relative path to the README
105+
abs_img_path="$base_dir/$img_path"
106+
fi
107+
108+
# Extract just the filename
109+
img_filename=$(basename "$img_path")
110+
wiki_img_path="images/$img_filename"
111+
112+
# Copy the image to wiki repository if it exists
113+
if [ -f "$abs_img_path" ]; then
114+
echo "Copying image: $abs_img_path -> ./wiki/$wiki_img_path"
115+
cp -v "$abs_img_path" "./wiki/$wiki_img_path" || echo "Error copying image"
116+
117+
# Escape special characters in the path for sed
118+
escaped_img_path=$(echo "$img_path" | sed 's/[\/&]/\\&/g')
119+
120+
# Replace the HTML image reference in content
121+
content=$(echo "$content" | sed "s|src=\"$escaped_img_path\"|src=\"$wiki_img_path\"|g")
122+
echo "Replaced HTML image reference: $img_path → $wiki_img_path"
123+
else
124+
echo "Warning: HTML image file not found: $abs_img_path"
125+
# Add more debug info
126+
echo "Current directory: $(pwd)"
127+
echo "Files in $base_dir:"
128+
ls -la "$base_dir"
129+
fi
90130
fi
91131
done < "./$rel_path"
92132

benchmarks/rotatingDrum/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This benchmark compares the performance of phasicFlow with a well-stablished com
1313
</div>
1414
</div>
1515

16-
..
16+
.
1717
<div align="center">
1818
<img src="./images/phasicFlow_snapshot.png" style="width: 400px;" />
1919
<div align="center">

0 commit comments

Comments
 (0)