MCPcopy Create free account
hub / github.com/AsyncFuncAI/deepwiki-open / generate_json_export

Function generate_json_export

api/api.py:369–391  ·  view source on GitHub ↗

Generate JSON export of wiki pages. Args: repo_url: The repository URL pages: List of wiki pages Returns: JSON content as string

(repo_url: str, pages: List[WikiPage])

Source from the content-addressed store, hash-verified

367 return markdown
368
369def generate_json_export(repo_url: str, pages: List[WikiPage]) -> str:
370 """
371 Generate JSON export of wiki pages.
372
373 Args:
374 repo_url: The repository URL
375 pages: List of wiki pages
376
377 Returns:
378 JSON content as string
379 """
380 # Create a dictionary with metadata and pages
381 export_data = {
382 "metadata": {
383 "repository": repo_url,
384 "generated_at": datetime.now().isoformat(),
385 "page_count": len(pages)
386 },
387 "pages": [page.model_dump() for page in pages]
388 }
389
390 # Convert to JSON string with pretty formatting
391 return json.dumps(export_data, indent=2)
392
393# Import the simplified chat implementation
394from api.simple_chat import chat_completions_stream

Callers 1

export_wikiFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected