Skip to content

Commit 4baec68

Browse files
committed
update reports to generate README.md
1 parent deb086d commit 4baec68

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

data/2024Q2/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11

22
## Country Report
3-
![Number of Google Webpages Licensed by Country](/Users/naishasinha/quantifying/data/2024Q2/3-reports/gcs_country_report.png)
3+
![Number of Google Webpages Licensed by Country](3-reports/gcs_country_report.png)
44
Number of Google Webpages Licensed by Country
55

66

77
## License Type Report
8-
![Number of Webpages Licensed by License Type](/Users/naishasinha/quantifying/data/2024Q2/3-reports/gcs_licensetype_report.png)
8+
![Number of Webpages Licensed by License Type](3-reports/gcs_licensetype_report.png)
99
Number of Webpages Licensed by License Type
1010

1111

1212
## Language Report
13-
![Number of Google Webpages Licensed by Language](/Users/naishasinha/quantifying/data/2024Q2/3-reports/gcs_language_report.png)
13+
![Number of Google Webpages Licensed by Language](3-reports/gcs_language_report.png)
1414
Number of Google Webpages Licensed by Language

scripts/3-reports/gcs_reports.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ def update_readme(image_path, description, section_title, args):
6565
readme_path = os.path.join(PATHS["data"], args.quarter, "README.md")
6666
section_marker = f"## {section_title}"
6767

68+
# Convert image path to a relative path
69+
rel_image_path = os.path.relpath(image_path, os.path.dirname(readme_path))
70+
6871
if os.path.exists(readme_path):
6972
with open(readme_path, "r") as f:
7073
lines = f.readlines()
@@ -83,7 +86,7 @@ def update_readme(image_path, description, section_title, args):
8386
section_start = len(lines) - 1
8487

8588
# Add the image and description
86-
lines.insert(section_start + 1, f"![{description}]({image_path})\n")
89+
lines.insert(section_start + 1, f"![{description}]({rel_image_path})\n")
8790
lines.insert(section_start + 2, f"{description}\n\n")
8891

8992
# Write back to the README.md file

0 commit comments

Comments
 (0)