Skip to content

Commit b70a44e

Browse files
committed
feat: new api documentation layout
1 parent 3b628b0 commit b70a44e

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

src/server/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
from pathlib import Path
77

88
from dotenv import load_dotenv
9-
from fastapi import FastAPI
9+
from fastapi import FastAPI, Request
1010
from fastapi.responses import FileResponse, HTMLResponse
1111
from fastapi.staticfiles import StaticFiles
1212
from slowapi.errors import RateLimitExceeded
1313
from starlette.middleware.trustedhost import TrustedHostMiddleware
1414

1515
from server.routers import dynamic, index, ingest
16+
from server.server_config import templates
1617
from server.server_utils import lifespan, limiter, rate_limit_exception_handler
1718

1819
# Load environment variables from .env file

src/server/templates/swagger_ui.jinja

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,40 @@
11
{% extends "base.jinja" %}
22
{% block title %}API Docs{% endblock %}
33
{% block content %}
4+
<div class="mb-8">
5+
<div class="relative w-full mx-auto flex sm:flex-row flex-col justify-center items-start sm:items-center">
6+
<svg class="h-auto w-16 sm:w-20 md:w-24 flex-shrink-0 p-2 md:relative sm:absolute lg:absolute left-0 lg:-translate-x-full lg:ml-32 md:translate-x-10 sm:-translate-y-16 md:-translate-y-0 -translate-x-2 lg:-translate-y-10"
7+
viewBox="0 0 91 98"
8+
fill="none"
9+
xmlns="http://www.w3.org/2000/svg">
10+
<path d="m35.878 14.162 1.333-5.369 1.933 5.183c4.47 11.982 14.036 21.085 25.828 24.467l5.42 1.555-5.209 2.16c-11.332 4.697-19.806 14.826-22.888 27.237l-1.333 5.369-1.933-5.183C34.56 57.599 24.993 48.496 13.201 45.114l-5.42-1.555 5.21-2.16c11.331-4.697 19.805-14.826 22.887-27.237Z" fill="#FE4A60" stroke="#000" stroke-width="3.445">
11+
</path>
12+
<path d="M79.653 5.729c-2.436 5.323-9.515 15.25-18.341 12.374m9.197 16.336c2.6-5.851 10.008-16.834 18.842-13.956m-9.738-15.07c-.374 3.787 1.076 12.078 9.869 14.943M70.61 34.6c.503-4.21-.69-13.346-9.49-16.214M14.922 65.967c1.338 5.677 6.372 16.756 15.808 15.659M18.21 95.832c-1.392-6.226-6.54-18.404-15.984-17.305m12.85-12.892c-.41 3.771-3.576 11.588-12.968 12.681M18.025 96c.367-4.21 3.453-12.905 12.854-14" stroke="#000" stroke-width="2.548" stroke-linecap="round">
13+
</path>
14+
</svg>
15+
<h1 class="text-4xl sm:text-5xl sm:pt-20 lg:pt-5 md:text-6xl lg:text-7xl font-bold tracking-tighter w-full inline-block text-left md:text-center relative">
16+
Gitingest API
17+
<br>
18+
Documentation
19+
</h1>
20+
<svg class="w-16 lg:w-20 h-auto lg:absolute flex-shrink-0 right-0 bottom-0 md:block hidden translate-y-10 md:translate-y-20 lg:translate-y-4 lg:-translate-x-12 -translate-x-10"
21+
viewBox="0 0 92 80"
22+
fill="none"
23+
xmlns="http://www.w3.org/2000/svg">
24+
<path d="m35.213 16.953.595-5.261 2.644 4.587a35.056 35.056 0 0 0 26.432 17.33l5.261.594-4.587 2.644A35.056 35.056 0 0 0 48.23 63.28l-.595 5.26-2.644-4.587a35.056 35.056 0 0 0-26.432-17.328l-5.261-.595 4.587-2.644a35.056 35.056 0 0 0 17.329-26.433Z" fill="#5CF1A4" stroke="#000" stroke-width="2.868" class="">
25+
</path>
26+
<path d="M75.062 40.108c1.07 5.255 1.072 16.52-7.472 19.54m7.422-19.682c1.836 2.965 7.643 8.14 16.187 5.121-8.544 3.02-8.207 15.23-6.971 20.957-1.97-3.343-8.044-9.274-16.588-6.254M12.054 28.012c1.34-5.22 6.126-15.4 14.554-14.369M12.035 28.162c-.274-3.487-2.93-10.719-11.358-11.75C9.104 17.443 14.013 6.262 15.414.542c.226 3.888 2.784 11.92 11.212 12.95" stroke="#000" stroke-width="2.319" stroke-linecap="round">
27+
</path>
28+
</svg>
29+
</div>
30+
<p class="text-gray-600 text-lg max-w-2xl mx-auto text-center mt-8">
31+
Turn any Git repository into a simple text digest of its codebase.
32+
</p>
33+
<p class="text-gray-600 text-lg max-w-2xl mx-auto text-center mt-0">
34+
This is useful for feeding a codebase into any LLM.
35+
</p>
36+
</div>
437
<div class="bg-[#fff4da] rounded-xl border-[3px] border-gray-900 p-4 md:p-8 relative z-20">
5-
<h1 class="text-3xl font-bold text-gray-900 mb-4">API Documentation</h1>
638
<div id="swagger-ui"></div>
739
</div>
840
<link rel="stylesheet"

0 commit comments

Comments
 (0)