docs: drop the generated gt reference

The per-command reference made the pages long and repeated what
gt <command> --help shows. Keep the guides and remove the generator,
its workflow and the sidebar handling it needed.

Signed-off-by: bircni <[email protected]>
This commit is contained in:
bircni committed 2026-10-22 18:31:31 +02:00
1 parent 011651ad16
commit 540757fe56
264 files changed
+11 -15121

No files matched your search

+8 -17
View File
@@ -96,23 +96,14 @@ interface Tree {
label(dir: string): string;
}
/**
* Sidebar of a directory tree, ordered by `sidebar_position`. A directory
* without `_category_.json` but with an `index` page, as the generated cli
* reference has one per command, takes its label and position from that page,
* which comes first in it.
*/
/** Sidebar of a directory tree, ordered by `sidebar_position`. */
function treeOf(pages: SidebarPage[]): Tree {
const categories = new Map<string, SidebarPage>();
const indexes = new Map<string, SidebarPage>();
for (const page of pages) {
if (page.meta.category) {
categories.set([page.meta.dir, page.meta.name].filter(Boolean).join('/'), page);
} else if (page.meta.name === 'index' && page.meta.dir) {
indexes.set(page.meta.dir, page);
}
if (!page.meta.category) continue;
const dir = [page.meta.dir, page.meta.name].filter(Boolean).join('/');
categories.set(dir, page);
}
const heading = (dir: string) => categories.get(dir) ?? indexes.get(dir);
const childDirs = (dir: string) => {
const prefix = dir ? `${dir}/` : '';
@@ -130,7 +121,7 @@ function treeOf(pages: SidebarPage[]): Tree {
const entries: { sort: [number, number, string]; entry: SidebarEntry }[] = [];
for (const child of childDirs(dir)) {
const category = heading(child);
const category = categories.get(child);
const label = category?.title ?? labelFromDirname(child.split('/').at(-1)!);
entries.push({
sort: [category?.meta.order ?? last, 0, label],
@@ -140,8 +131,7 @@ function treeOf(pages: SidebarPage[]): Tree {
for (const page of pages) {
if (page.meta.dir !== dir || page.meta.category || page.hidden) continue;
const order = indexes.get(dir) === page ? -last : (page.meta.order ?? last);
entries.push({ sort: [order, 1, page.title], entry: link(page) });
entries.push({ sort: [page.meta.order ?? last, 1, page.title], entry: link(page) });
}
return entries
@@ -152,7 +142,8 @@ function treeOf(pages: SidebarPage[]): Tree {
.map((item) => item.entry);
};
const label = (dir: string) => heading(dir)?.title ?? labelFromDirname(dir.split('/').at(-1)!);
const label = (dir: string) =>
categories.get(dir)?.title ?? labelFromDirname(dir.split('/').at(-1)!);
return { build, label };
}