Files
reuse-surface/docs/catalog/search.html
tegwick e766f38e6f
Some checks failed
ci / validate-registry (push) Has been cancelled
Complete WP-0006 through WP-0009: registry expansion, catalog, graph, tests
Register six new capabilities (12 total), add searchable catalog UI and graph
explorer, introduce pytest suite with CI fail-on-warnings, and close gap
analysis priorities 13 and 16. WP-0010 remains backlog for network federation.
2026-06-15 02:24:20 +02:00

45 lines
1.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Capability Catalog Search</title>
<style>
body { font-family: system-ui, sans-serif; margin: 2rem; line-height: 1.5; }
input { width: 100%; max-width: 40rem; padding: 0.5rem; font-size: 1rem; }
.card { border: 1px solid #ddd; border-radius: 8px; padding: 1rem; margin: 1rem 0; }
.meta { color: #555; font-size: 0.9rem; }
.hidden { display: none; }
</style>
</head>
<body>
<h1>Capability Catalog</h1>
<p>Client-side search over <code>registry.json</code>. Generated by <code>reuse-surface catalog</code>.</p>
<input id="q" type="search" placeholder="Search name, summary, tags, vector..." autofocus>
<p id="count"></p>
<div id="results"></div>
<script>
let items = [];
fetch('registry.json').then(r => r.json()).then(data => {
items = data.capabilities || [];
render('');
});
document.getElementById('q').addEventListener('input', e => render(e.target.value));
function render(query) {
const q = query.trim().toLowerCase();
const matches = items.filter(item => {
const hay = [item.id, item.name, item.summary, item.vector,
...(item.tags || []), ...(item.consumption_modes || [])].join(' ').toLowerCase();
return !q || hay.includes(q);
});
document.getElementById('count').textContent = matches.length + ' match(es)';
document.getElementById('results').innerHTML = matches.map(item => `
<article class="card">
<h3>${item.name}</h3>
<p class="meta"><code>${item.id}</code> · ${item.vector} · ${item.owner}</p>
<p>${item.summary}</p>
</article>`).join('');
}
</script>
</body>
</html>