Skip to content

Commit 0787051

Browse files
authored
Merge pull request #268 from creativecommons/readme-sections-and-entries
Improve reliability of entries and clarity of sections
2 parents c6862cf + 4838cf7 commit 0787051

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/shared.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,12 +326,12 @@ def update_readme(
326326
readme_path = path_join(paths["data"], args.quarter, "README.md")
327327

328328
# Define section markers for each data source
329-
section_start_line = f"<!-- section start {section_file} -->\n"
330-
section_end_line = f"<!-- section end {section_file} -->\n"
329+
section_start_line = f"<!-- SECTION start {section_file} -->\n"
330+
section_end_line = f"<!-- SECTION end {section_file} -->\n"
331331

332332
# Define entry markers for each plot (optional) and description
333-
entry_start_line = f"<!-- entry start {entry_title} -->\n"
334-
entry_end_line = f"<!-- entry end {entry_title} -->\n"
333+
entry_start_line = f"<!-- {section_file} entry start {entry_title} -->\n"
334+
entry_end_line = f"<!-- {section_file} entry end {entry_title} -->\n"
335335

336336
if os.path.exists(readme_path):
337337
with open(readme_path, "r", encoding="utf-8") as f:
@@ -356,7 +356,7 @@ def update_readme(
356356
sections_before = ordered_sections[:current_postion]
357357
# we find the last existing section that comes before this section
358358
for prev_section_title in reversed(sections_before):
359-
prev_end_line = f"<!-- section end {prev_section_title} -->\n"
359+
prev_end_line = f"<!-- SECTION end {prev_section_title} -->\n"
360360
if prev_end_line in lines:
361361
insert_index = lines.index(prev_end_line) + 1
362362
break

0 commit comments

Comments
 (0)