Skip to content

feat: add wiki ZIP export endpoint and download buttons#44

Open
Selene29 wants to merge 3 commits intorepowise-dev:mainfrom
Selene29:feat/wiki-export
Open

feat: add wiki ZIP export endpoint and download buttons#44
Selene29 wants to merge 3 commits intorepowise-dev:mainfrom
Selene29:feat/wiki-export

Conversation

@Selene29
Copy link
Copy Markdown

@Selene29 Selene29 commented Apr 5, 2026

Summary

  • Add GET /api/repos/{repo_id}/export endpoint that returns a ZIP archive with pages organized as wiki/{page_type}/{target_path}.md
  • Add "Download ZIP" button next to "Export All" on the docs page
  • Add "Export" button in the operations panel on the settings page

The docs page already had a markdown "Export All" button; this adds a structured ZIP alternative that preserves folder hierarchy.

Test plan

  • Unit tests for export endpoint (success + 404)
  • Manual: click "Download ZIP" on docs page, verify ZIP contains organized markdown files
  • Manual: click "Export" in operations panel, verify same ZIP download

@RaghavChamadiya
Copy link
Copy Markdown
Collaborator

The ZIP approach is clean and the folder structure is a good improvement over the flat export. Tests look good.

One issue before merge: crud.list_pages(session, repo_id, limit=10000) silently truncates the export for large repos. Looking at the signature, list_pages takes limit: int with no None support, so the export endpoint should use its own direct query instead:

from sqlalchemy import select
pages = (await session.execute(select(Page).where(Page.repository_id == repo_id))).scalars().all()

That removes the cap entirely without touching the shared CRUD function.

Selene29 added 2 commits April 6, 2026 12:43
GET /api/repos/{repo_id}/export returns a ZIP archive with pages
organized as wiki/{page_type}/{target_path}.md. Includes tests for
success and 404 cases.
Add "Download ZIP" button next to "Export All" on the docs page, and
an "Export" button in the operations panel. Both link to the new
GET /api/repos/{repo_id}/export endpoint.
Reviewer feedback: crud.list_pages silently truncates at the limit arg.
Use a direct select(Page) query instead so large repos export fully.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants