style the live libraries table + add Language column
- libraries.md: render the live lib list as a 3-column table (Library / What it does / Language), wrapped in .rt-lib-table so it picks up explicit styling (Material only auto-styles markdown tables, not innerHTML-injected ones — that's why it rendered bare before). - extra.css: branded table (navy header, blue borders, hover rows, code-styled linked names) and a blue Language badge. Verified in-browser against real Gitea API data (14 repos fetched, handbook denylisted -> 13 libs): table renders sorted with language badges, matches the theme. Live load on prod still needs Gitea CORS (app.ini [cors] ALLOW_DOMAIN = the docs origin). Signed-off-by: disqualifier <dev@disqualifier.me>
This commit is contained in:
+8
-3
@@ -89,12 +89,17 @@ Pin a tag in your dependencies — never an unpinned branch:
|
||||
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>";
|
||||
var lang = r.language
|
||||
? '<span class="rt-lang">' + escapeHtml(r.language) + "</span>"
|
||||
: '<span class="rt-lang rt-lang--none">—</span>';
|
||||
return '<tr><td><a href="' + escapeHtml(url) + '"><code>' +
|
||||
escapeHtml(r.name) + '</code></a></td><td>' + desc + '</td></tr>';
|
||||
escapeHtml(r.name) + "</code></a></td><td>" + desc +
|
||||
"</td><td>" + lang + "</td></tr>";
|
||||
}).join("");
|
||||
el.innerHTML =
|
||||
'<table><thead><tr><th>Library</th><th>What it does</th></tr></thead>' +
|
||||
'<tbody>' + rows + '</tbody></table>';
|
||||
'<div class="rt-lib-table"><table>' +
|
||||
"<thead><tr><th>Library</th><th>What it does</th><th>Language</th></tr></thead>" +
|
||||
"<tbody>" + rows + "</tbody></table></div>";
|
||||
}
|
||||
|
||||
function fail() {
|
||||
|
||||
Reference in New Issue
Block a user