@ts-for-gir/typedoc-theme 4.0.0-beta.44 → 4.0.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/src/partials/module-reflection.ts +7 -2
- package/src/partials/sidebar.ts +5 -1
- package/src/theme.ts +13 -1
- package/src/utils.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ts-for-gir/typedoc-theme",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-rc.10",
|
|
4
4
|
"description": "Custom TypeDoc theme inspired by gi-docgen for ts-for-gir",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"module": "src/index.ts",
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
".": "./src/index.ts"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@ts-for-gir/tsconfig": "^4.0.0-
|
|
38
|
+
"@ts-for-gir/tsconfig": "^4.0.0-rc.10",
|
|
39
39
|
"@types/lunr": "^2.3.7",
|
|
40
|
-
"@types/node": "^
|
|
41
|
-
"typescript": "^6.0.
|
|
40
|
+
"@types/node": "^25.6.0",
|
|
41
|
+
"typescript": "^6.0.3"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"lunr": "^2.3.9",
|
|
45
|
-
"typedoc": "^0.28.
|
|
45
|
+
"typedoc": "^0.28.19"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -82,7 +82,7 @@ export function getMemberSections(parent: ContainerReflection): MemberSection[]
|
|
|
82
82
|
// ---------------------------------------------------------------------------
|
|
83
83
|
|
|
84
84
|
const CATEGORY_ORDER = [
|
|
85
|
-
"GJS
|
|
85
|
+
"GJS",
|
|
86
86
|
"GLib",
|
|
87
87
|
"GTK 4",
|
|
88
88
|
"GTK 3",
|
|
@@ -90,8 +90,13 @@ const CATEGORY_ORDER = [
|
|
|
90
90
|
"Graphics",
|
|
91
91
|
"Text Rendering",
|
|
92
92
|
"Multimedia",
|
|
93
|
+
"GNOME Shell",
|
|
93
94
|
"Web",
|
|
94
|
-
"
|
|
95
|
+
"Networking",
|
|
96
|
+
"Data & Markup",
|
|
97
|
+
"Security",
|
|
98
|
+
"System",
|
|
99
|
+
"GNOME Desktop",
|
|
95
100
|
];
|
|
96
101
|
|
|
97
102
|
export function renderCategorizedProject(
|
package/src/partials/sidebar.ts
CHANGED
|
@@ -120,7 +120,11 @@ export const giDocgenSidebar = (context: GiDocgenThemeRenderContext, props: Page
|
|
|
120
120
|
const nsMeta = owningModule ? getGirNamespaceMetadata(props.model) : undefined;
|
|
121
121
|
|
|
122
122
|
// Logo: use module logo if available, otherwise default project logo
|
|
123
|
-
const logoUrl = nsMeta?.logoUrl
|
|
123
|
+
const logoUrl = nsMeta?.logoUrl
|
|
124
|
+
? nsMeta.logoUrl.startsWith("http://") || nsMeta.logoUrl.startsWith("https://")
|
|
125
|
+
? nsMeta.logoUrl
|
|
126
|
+
: context.relativeURL(nsMeta.logoUrl, true)
|
|
127
|
+
: context.relativeURL("assets/logo_x4.png", true);
|
|
124
128
|
const logoAlt = nsMeta?.displayName || nsMeta?.namespace || "GJS TypeScript Definitions";
|
|
125
129
|
const logoHref = owningModule ? context.urlTo(owningModule) : context.relativeURL("index.html", true);
|
|
126
130
|
|
package/src/theme.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { copyFileSync, writeFileSync } from "node:fs";
|
|
1
|
+
import { copyFileSync, existsSync, mkdirSync, readdirSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { dirname, join } from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import type { NavigationElement, ProjectReflection, Renderer } from "typedoc";
|
|
@@ -60,6 +60,18 @@ export class GiDocgenTheme extends DefaultTheme {
|
|
|
60
60
|
copyFileSync(join(faviconDir, file), join(assetsDir, file));
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
// Copy round library icons from refs/library-icons submodule
|
|
64
|
+
const iconsSourceDir = join(__dirname, "..", "..", "..", "refs", "library-icons", "library-icons");
|
|
65
|
+
const iconsOutputDir = join(assetsDir, "library-icons");
|
|
66
|
+
if (existsSync(iconsSourceDir)) {
|
|
67
|
+
mkdirSync(iconsOutputDir, { recursive: true });
|
|
68
|
+
for (const file of readdirSync(iconsSourceDir)) {
|
|
69
|
+
if (file.endsWith("-r.svg")) {
|
|
70
|
+
copyFileSync(join(iconsSourceDir, file), join(iconsOutputDir, file));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
63
75
|
// Generate site.webmanifest with configurable name
|
|
64
76
|
const projectName = event.project.name || "TS for GIR";
|
|
65
77
|
const manifest = {
|