Skip to content

Commit 6001f83

Browse files
author
Nora
committed
fix(readme): normalize image paths via config to restore README/Pages rendering
1 parent 2752370 commit 6001f83

File tree

8 files changed

+23
-14
lines changed

8 files changed

+23
-14
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
[![Discord](https://img.shields.io/badge/💬_Discord-Join_Discussion-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/awBHrRJx)
2323
[![Issues](https://img.shields.io/badge/💡_GitHub-Open_Issue-181717?style=for-the-badge&logo=github&logoColor=white)](https://github.com/DeepSoftwareAnalytics/Awesome-Issue-Resolution/issues)
2424

25-
<img src="docs/images/awesome-issue-resolution.png" alt="Awesome Issue Resolution" width="60%">
25+
<img src="app/docs/images/awesome-issue-resolution.png" alt="Awesome Issue Resolution" width="60%">
2626

2727
</div>
2828

@@ -91,7 +91,7 @@ Based on a systematic review of **204 papers and online resources**, this survey
9191
9292
<!-- START DEMO -->
9393
<div align="center">
94-
<img src="docs/images/database.gif" alt="Admin Interface Demo" style="zoom:50%;" />
94+
<img src="app/docs/images/database.gif" alt="Admin Interface Demo" style="zoom:50%;" />
9595

9696
</div>
9797
<!-- END DEMO -->

app/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ def script(name: str) -> Path:
4242
HOST = '0.0.0.0'
4343
PORT = 5000
4444
DEBUG = True
45+
46+
README_IMAGE_PREFIX = 'app/docs/images'
47+
DOCS_IMAGE_PREFIX = 'images'

app/view/sync_readme.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,21 @@
126126
)
127127

128128

129+
def normalize_readme_asset_paths(content: str) -> str:
130+
image_prefix = getattr(config, 'README_IMAGE_PREFIX', 'app/docs/images').rstrip('/')
131+
content = re.sub(
132+
r'(<img\s+[^>]*src=["\'])docs/images/',
133+
rf'\1{image_prefix}/',
134+
content
135+
)
136+
content = re.sub(
137+
r'(\!\[[^\]]*\]\()docs/images/',
138+
rf'\1{image_prefix}/',
139+
content
140+
)
141+
return content
142+
143+
129144
def load_yaml(path: Path) -> List[Dict]:
130145
"""Load YAML file and return list of entries."""
131146
if not path.exists():
@@ -381,7 +396,8 @@ def update_readme() -> bool:
381396
print(f"[ERROR] {README_PATH} does not exist!", file=sys.stderr)
382397
return False
383398

384-
content = README_PATH.read_text(encoding="utf-8")
399+
raw_content = README_PATH.read_text(encoding="utf-8")
400+
content = normalize_readme_asset_paths(raw_content)
385401

386402
# Check if papers markers exist
387403
if "<!-- START PAPERS -->" not in content:
@@ -437,7 +453,7 @@ def update_readme() -> bool:
437453
)
438454

439455
# Write back to file
440-
if new_content != content:
456+
if new_content != raw_content:
441457
README_PATH.write_text(new_content, encoding="utf-8")
442458
print("\n✓ README.md updated successfully!")
443459
return True

templates/table1_datasets.csv

Lines changed: 0 additions & 2 deletions
This file was deleted.

templates/table2_trajectories.csv

Lines changed: 0 additions & 2 deletions
This file was deleted.

templates/table3_sft_models.csv

Lines changed: 0 additions & 2 deletions
This file was deleted.

templates/table4_rl_models.csv

Lines changed: 0 additions & 2 deletions
This file was deleted.

templates/table5_general_models.csv

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)