Skip to content

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

Merged
RaghavChamadiya merged 3 commits intorepowise-dev:mainfrom
Selene29:feat/wiki-export
Apr 11, 2026
Merged

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

Conversation

@Selene29
Copy link
Copy Markdown
Contributor

@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.
@RaghavChamadiya
Copy link
Copy Markdown
Collaborator

Hey @Selene29, just checking, did you get a chance to look at the list_pages limit issue? Happy to merge once that's addressed.

Copy link
Copy Markdown
Collaborator

@RaghavChamadiya RaghavChamadiya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Truncation fix looks good, exactly what I had in mind. Thanks for the quick update, merging!

@RaghavChamadiya RaghavChamadiya merged commit 1d9907d into repowise-dev:main Apr 11, 2026
@Selene29 Selene29 deleted the feat/wiki-export branch April 11, 2026 07:37
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