View generated documentation.
(self, job_id: str)
| 161 | return JobStatusResponse(**asdict(job)) |
| 162 | |
| 163 | async def view_docs(self, job_id: str) -> RedirectResponse: |
| 164 | """View generated documentation.""" |
| 165 | job = self.background_worker.get_job_status(job_id) |
| 166 | if not job: |
| 167 | raise HTTPException(status_code=404, detail="Job not found") |
| 168 | |
| 169 | if job.status != 'completed' or not job.docs_path: |
| 170 | raise HTTPException(status_code=404, detail="Documentation not available") |
| 171 | |
| 172 | docs_path = Path(job.docs_path) |
| 173 | if not docs_path.exists(): |
| 174 | raise HTTPException(status_code=404, detail="Documentation files not found") |
| 175 | |
| 176 | # Redirect to the documentation viewer |
| 177 | return RedirectResponse(url=f"/static-docs/{job_id}/", status_code=status.HTTP_302_FOUND) |
| 178 | |
| 179 | async def serve_generated_docs(self, job_id: str, filename: str = "overview.md") -> HTMLResponse: |
| 180 | """Serve generated documentation files.""" |
no test coverage detected