Replace the four-section dir layout with the revised flat-page spec: - Three-page nav: Libraries, Standards, Deploy. - libraries.md: live client-side fetch of the rethink-public org from the Gitea API, denylist-filtered, sorted table linking each repo, no version pins, graceful fallback on fetch/CORS failure. - standards.md: house coding standards. - deploy.md: deploy guide for rethink-net (services uid 1337, uid-agnostic Docker, paths/mounts, bind-mount permissions, read-only secrets). - index.md landing card grid updated for the three sections. - gitignore Playwright MCP artifacts. Verified: mkdocs build --strict clean; libraries fallback renders live. Signed-off-by: disqualifier <dev@disqualifier.me>
95 lines
3.4 KiB
Markdown
95 lines
3.4 KiB
Markdown
# Libraries
|
|
|
|
The shared `rethink-public` library suite. Before hand-rolling common
|
|
functionality — retry/backoff, logging setup, HTTP sessions, proxies, webhooks,
|
|
IMAP/mail, datastore/KV, crypto, `discord.py` helpers, timing/paths/masking
|
|
utilities — check here first and prefer an existing lib.
|
|
|
|
This list is pulled live from Gitea, so a new library in the org shows up on the
|
|
next page load — nothing here is rebuilt or version-pinned. Each entry links to
|
|
the repo, where the README and tags live.
|
|
|
|
## Install
|
|
|
|
```
|
|
<lib> @ git+https://git.rethinkstudios.io/rethink-public/<lib>.git@<tag>
|
|
```
|
|
|
|
<div id="lib-list" markdown="0">
|
|
<p class="lib-status">Loading libraries from Gitea…</p>
|
|
</div>
|
|
|
|
<script>
|
|
(function () {
|
|
var API = "https://git.rethinkstudios.io/api/v1/orgs/rethink-public/repos?limit=50";
|
|
var REPO_BASE = "https://git.rethinkstudios.io/rethink-public";
|
|
var FALLBACK =
|
|
'Could not load the live list. View the libraries directly at ' +
|
|
'<a href="' + REPO_BASE + '">git.rethinkstudios.io/rethink-public</a>.';
|
|
|
|
// Non-library repos to exclude from the render.
|
|
var DENYLIST = ["handbook", ".profile", ".profile-private"];
|
|
|
|
function isLibrary(repo) {
|
|
if (!repo || !repo.name) return false;
|
|
if (repo.name.charAt(0) === ".") return false; // any dot-repo
|
|
return DENYLIST.indexOf(repo.name) === -1;
|
|
}
|
|
|
|
function escapeHtml(s) {
|
|
return String(s == null ? "" : s)
|
|
.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">")
|
|
.replace(/"/g, """);
|
|
}
|
|
|
|
function render(repos) {
|
|
var libs = repos.filter(isLibrary).sort(function (a, b) {
|
|
return a.name.localeCompare(b.name);
|
|
});
|
|
var el = document.getElementById("lib-list");
|
|
if (!libs.length) {
|
|
el.innerHTML = '<p class="lib-status">No libraries found. Browse the org at ' +
|
|
'<a href="' + REPO_BASE + '">git.rethinkstudios.io/rethink-public</a>.</p>';
|
|
return;
|
|
}
|
|
var rows = libs.map(function (r) {
|
|
var url = r.html_url || (REPO_BASE + "/" + r.name);
|
|
var desc = r.description ? escapeHtml(r.description) : "<em>No description.</em>";
|
|
return '<tr><td><a href="' + escapeHtml(url) + '"><code>' +
|
|
escapeHtml(r.name) + '</code></a></td><td>' + desc + '</td></tr>';
|
|
}).join("");
|
|
el.innerHTML =
|
|
'<table><thead><tr><th>Library</th><th>What it does</th></tr></thead>' +
|
|
'<tbody>' + rows + '</tbody></table>';
|
|
}
|
|
|
|
function fail() {
|
|
document.getElementById("lib-list").innerHTML =
|
|
'<p class="lib-status">' + FALLBACK + '</p>';
|
|
}
|
|
|
|
try {
|
|
fetch(API, { headers: { "Accept": "application/json" } })
|
|
.then(function (resp) {
|
|
if (!resp.ok) throw new Error("HTTP " + resp.status);
|
|
return resp.json();
|
|
})
|
|
.then(function (data) {
|
|
if (!Array.isArray(data)) throw new Error("unexpected response");
|
|
render(data);
|
|
})
|
|
.catch(fail);
|
|
} catch (e) {
|
|
fail();
|
|
}
|
|
})();
|
|
</script>
|
|
|
|
!!! info "If the live list is empty or stale"
|
|
The fetch runs in your browser against the Gitea API and needs the org repos
|
|
to be readable unauthenticated (they are — it's a public org) and CORS to
|
|
allow the docs domain. If the list won't load, browse the org directly at
|
|
[git.rethinkstudios.io/rethink-public](https://git.rethinkstudios.io/rethink-public).
|
|
The fallback for a disabled live fetch is a webhook rebuild — a push to any
|
|
`rethink-public` repo triggers a site rebuild.
|