readmd.md update

This commit is contained in:
Hamidreza 2025-04-30 08:14:10 +03:30
parent 166d7e72c2
commit c7f790a1fa
3 changed files with 54 additions and 39 deletions

View File

@ -86,53 +86,68 @@ jobs:
fi fi
done done
# Process HTML img tags separately # Process HTML img tags separately - preserving all attributes
echo "Processing HTML image references..." echo "Processing HTML image references..."
# Extract src attributes from img tags using grep and sed # Store the file content in a temporary variable to process with awk
for img_src in $(grep -o '<img [^>]*src="[^"]*"' "./$rel_path" | sed -E 's/.*src="([^"]*)".*/\1/'); do readme_content=$(cat "./$rel_path")
# Skip URLs
if [[ $img_src == http* ]]; then # Use awk to find all img tags and process them
continue img_tags=$(echo "$readme_content" | grep -o '<img[^>]*>' || echo "")
fi if [ -n "$img_tags" ]; then
echo "Found HTML img tags to process"
# Determine the absolute path of the image echo "$img_tags" | while read -r img_tag; do
if [[ $img_src == /* ]]; then # Extract src attribute
# Absolute path within repository img_src=$(echo "$img_tag" | grep -o 'src="[^"]*"' | sed 's/src="\([^"]*\)"/\1/')
abs_img_path="./$img_src"
else
# Relative path to the README
abs_img_path="$base_dir/$img_src"
fi
# Extract just the filename
img_filename=$(basename "$img_src")
wiki_img_path="images/$img_filename"
# Copy the image to wiki repository if it exists
if [ -f "$abs_img_path" ]; then
echo "Copying image: $abs_img_path -> ./wiki/$wiki_img_path"
cp -v "$abs_img_path" "./wiki/$wiki_img_path" || echo "Error copying image"
# Escape special characters in the path for sed # Skip if no src or if it's a URL
escaped_img_src=$(echo "$img_src" | sed 's/[\/&]/\\&/g') if [ -z "$img_src" ] || [[ $img_src == http* ]]; then
continue
fi
# Replace the HTML image reference in content # Determine the absolute path of the image
content=$(echo "$content" | sed "s|src=\"$escaped_img_src\"|src=\"$wiki_img_path\"|g") if [[ $img_src == /* ]]; then
echo "Replaced HTML image reference: $img_src → $wiki_img_path" # Absolute path within repository
else abs_img_path="./$img_src"
echo "Warning: HTML image file not found: $abs_img_path" else
echo "Current directory: $(pwd)" # Relative path to the README
echo "Files in $base_dir:" abs_img_path="$base_dir/$img_src"
ls -la "$base_dir" fi
fi
done # Extract just the filename
img_filename=$(basename "$img_src")
wiki_img_path="images/$img_filename"
# Copy the image to wiki repository if it exists
if [ -f "$abs_img_path" ]; then
echo "Copying image: $abs_img_path -> ./wiki/$wiki_img_path"
cp -v "$abs_img_path" "./wiki/$wiki_img_path" || echo "Error copying image"
# Escape special characters in the path for sed
escaped_img_src=$(echo "$img_src" | sed 's/[\/&]/\\&/g')
escaped_img_tag=$(echo "$img_tag" | sed 's/[\/&]/\\&/g')
# Create the new tag with the updated src but preserving all other attributes
new_img_tag=$(echo "$img_tag" | sed "s|src=\"$escaped_img_src\"|src=\"$wiki_img_path\"|g")
# Replace the entire img tag in content
content=$(echo "$content" | sed "s|$escaped_img_tag|$new_img_tag|g")
echo "Replaced HTML image tag while preserving all attributes"
else
echo "Warning: HTML image file not found: $abs_img_path"
# Add more debug info
echo "Current directory: $(pwd)"
echo "Files in $base_dir:"
ls -la "$base_dir"
fi
done
fi
# Debug output # Debug output
echo "Wiki page content preview (first 100 chars): ${content:0:100}" echo "Wiki page content preview (first 100 chars): ${content:0:100}"
# Replace the wiki page with the updated content rather than appending # Replace the wiki page with the updated content rather than appending
mkdir -p "$(dirname "./wiki/$wiki_page")" # Ensure directory exists mkdir -p "$(dirname "./wiki/$wiki_page")" # Ensure directory exists
echo -e "# $(basename "$wiki_page" .md)\n\nContent from $rel_path:\n\n$content" > "./wiki/$wiki_page" echo -e "# $(basename "$wiki_page" .md)\n\n$content" > "./wiki/$wiki_page"
echo "Updated wiki page: $wiki_page" echo "Updated wiki page: $wiki_page"
fi fi
done done

View File

Before

Width:  |  Height:  |  Size: 549 KiB

After

Width:  |  Height:  |  Size: 549 KiB

View File

@ -7,7 +7,7 @@ This benchmark compares the performance of phasicFlow with a well-stablished com
## Simulation Setup ## Simulation Setup
<div align="center"> <div align="center">
<img src="./images/commerical DEM snapshot.png" style="width: 400px;" /> <img src="./images/commericalDEMsnapshot.png" style="width: 400px;" />
<div align="center"> <div align="center">
<p>Figure 1. Commercial DEM simulation snapshot</p> <p>Figure 1. Commercial DEM simulation snapshot</p>
</div> </div>