Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/archive/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Archive Index
- [Archive](README.md)
6 changes: 4 additions & 2 deletions scripts/sync_chat_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
def main():
ARCHIVE_DIR.mkdir(parents=True, exist_ok=True)
files = sorted([p for p in ARCHIVE_DIR.glob("**/*") if p.is_file() and p.suffix.lower() in (".md",".txt") and p.name != "index.md"])
lines = ["# Archive Index\\n"]
# Start the index with a proper header line; no extra backslash needed
lines = ["# Archive Index"]
for p in files:
rel = p.relative_to(ARCHIVE_DIR)
# extract top-level header if present
Expand All @@ -22,7 +23,8 @@ def main():
pass
display = title or rel.as_posix()
lines.append(f"- [{display}]({rel.as_posix()})")
INDEX.write_text("\\n".join(lines), encoding="utf-8")
# Join lines with actual newlines and write out the index file
INDEX.write_text("\n".join(lines) + "\n", encoding="utf-8")
print(f"[OK] Indexed {len(files)} items to {INDEX}")

if __name__ == "__main__":
Expand Down
Loading