generated from coulomb/repo-seed
Documentation, terminology repo cleanup.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""Repository Ability Registry."""
|
||||
"""Repository Scoping."""
|
||||
|
||||
__all__ = ["__version__"]
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ class ScopeGenerator:
|
||||
"",
|
||||
"> This file helps you quickly understand what this repository is about,",
|
||||
"> when it is relevant, and when it is not.",
|
||||
"> It was generated from approved repo-registry characteristics.",
|
||||
"> It was generated from approved repo-scoping characteristics.",
|
||||
"",
|
||||
"---",
|
||||
"",
|
||||
|
||||
@@ -113,7 +113,7 @@ def get_service(settings: Settings = Depends(get_settings)) -> RegistryService:
|
||||
|
||||
API_DESCRIPTION = (
|
||||
"Register repositories, analyze their observable implementation facts, "
|
||||
"curate reviewable ability graphs, and search approved repository abilities."
|
||||
"curate reviewable scope graphs, and search approved repository characteristics."
|
||||
)
|
||||
|
||||
OPENAPI_TAGS = [
|
||||
@@ -128,7 +128,7 @@ OPENAPI_TAGS = [
|
||||
]
|
||||
|
||||
app = FastAPI(
|
||||
title="Repository Ability Registry",
|
||||
title="Repository Scoping",
|
||||
version="0.1.0",
|
||||
description=API_DESCRIPTION,
|
||||
openapi_tags=OPENAPI_TAGS,
|
||||
|
||||
@@ -2,6 +2,7 @@ from __future__ import annotations
|
||||
|
||||
from dataclasses import asdict
|
||||
from html import escape
|
||||
from pathlib import Path
|
||||
from urllib.parse import quote_plus
|
||||
|
||||
from fastapi import APIRouter, Depends, Form, HTTPException, Query
|
||||
@@ -13,6 +14,7 @@ from repo_registry.web_api.app import get_service
|
||||
|
||||
|
||||
router = APIRouter(include_in_schema=False)
|
||||
APP_NAME = "Repository Scoping"
|
||||
|
||||
|
||||
def page(title: str, body: str) -> HTMLResponse:
|
||||
@@ -23,7 +25,7 @@ def page(title: str, body: str) -> HTMLResponse:
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{escape(title)} · Repository Ability Registry</title>
|
||||
<title>{escape(title)} · {APP_NAME}</title>
|
||||
<style>
|
||||
:root {{
|
||||
color-scheme: light;
|
||||
@@ -151,6 +153,18 @@ def page(title: str, body: str) -> HTMLResponse:
|
||||
.tree ul {{ margin: 8px 0 0 20px; padding: 0; }}
|
||||
.tree li {{ margin: 6px 0; }}
|
||||
.source {{ color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }}
|
||||
.scope-document {{
|
||||
margin: 0;
|
||||
padding: 16px;
|
||||
overflow-x: auto;
|
||||
white-space: pre-wrap;
|
||||
overflow-wrap: anywhere;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 8px;
|
||||
background: #fbfcfd;
|
||||
color: #1f2933;
|
||||
font: 13px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
|
||||
}}
|
||||
.actions {{ display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }}
|
||||
[data-pending] {{ display: none; color: var(--muted); }}
|
||||
form.is-submitting [data-pending] {{ display: inline; }}
|
||||
@@ -168,10 +182,11 @@ def page(title: str, body: str) -> HTMLResponse:
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a href="/ui"><strong>Repository Ability Registry</strong></a>
|
||||
<a href="/ui"><strong>{APP_NAME}</strong></a>
|
||||
<nav class="actions">
|
||||
<a href="/ui/search">Search</a>
|
||||
<a href="/ui/discovery">Discovery</a>
|
||||
<a href="/ui/scope">SCOPE</a>
|
||||
<a href="/docs">API Docs</a>
|
||||
</nav>
|
||||
</header>
|
||||
@@ -262,6 +277,24 @@ def repository_index(service: RegistryService = Depends(get_service)) -> HTMLRes
|
||||
return render_repository_index(service)
|
||||
|
||||
|
||||
@router.get("/ui/scope")
|
||||
def scope_document() -> HTMLResponse:
|
||||
scope_path = Path("SCOPE.md")
|
||||
if scope_path.exists():
|
||||
content = scope_path.read_text(encoding="utf-8")
|
||||
rendered = f'<pre class="scope-document">{escape(content)}</pre>'
|
||||
else:
|
||||
rendered = '<p class="muted">No SCOPE.md file was found in this checkout.</p>'
|
||||
body = f"""
|
||||
<h1>SCOPE.md</h1>
|
||||
<section class="panel stack">
|
||||
<p class="muted">Canonical scope summary for this repository.</p>
|
||||
{rendered}
|
||||
</section>
|
||||
"""
|
||||
return page("SCOPE.md", body)
|
||||
|
||||
|
||||
@router.get("/ui/discovery")
|
||||
def discovery_page(service: RegistryService = Depends(get_service)) -> HTMLResponse:
|
||||
repositories = service.list_repositories()
|
||||
|
||||
Reference in New Issue
Block a user