Update API documentation iframe source and add static HTML file for PyPI Stats API Reference

This commit is contained in:
Luke Hagar
2025-08-14 21:30:12 -05:00
parent faaa2a2b97
commit 11d6b2fe96
2 changed files with 39 additions and 1 deletions

View File

@@ -30,7 +30,7 @@
<!-- Scalar API Reference iframe -->
<div class="rounded-lg border border-gray-800 bg-gray-900 overflow-hidden">
<iframe
src="https://cdn.jsdelivr.net/npm/@scalar/api-reference/dist/index.html?url=https://pypistats.dev/openapi.yaml"
src="/api-docs.html"
class="w-full h-[800px] border-0"
title="PyPI Stats API Documentation"
loading="lazy"

38
static/api-docs.html Normal file
View File

@@ -0,0 +1,38 @@
<!doctype html>
<html>
<head>
<title>PyPI Stats API Reference</title>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1" />
<style>
body {
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
#app {
width: 100%;
height: 100vh;
}
</style>
</head>
<body>
<div id="app"></div>
<!-- Load the Script -->
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
<!-- Initialize the Scalar API Reference -->
<script>
Scalar.createApiReference('#app', {
// The URL of the OpenAPI/Swagger document
url: 'https://pypistats.dev/openapi.yaml',
// Avoid CORS issues
proxyUrl: 'https://proxy.scalar.com',
})
</script>
</body>
</html>