@ts-for-gir/typedoc-theme 4.0.0-rc.1 → 4.0.0-rc.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ts-for-gir/typedoc-theme",
3
- "version": "4.0.0-rc.1",
3
+ "version": "4.0.0-rc.2",
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,7 +35,7 @@
35
35
  ".": "./src/index.ts"
36
36
  },
37
37
  "devDependencies": {
38
- "@ts-for-gir/tsconfig": "^4.0.0-rc.1",
38
+ "@ts-for-gir/tsconfig": "^4.0.0-rc.2",
39
39
  "@types/lunr": "^2.3.7",
40
40
  "@types/node": "^24.12.2",
41
41
  "typescript": "^6.0.2"
@@ -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 || context.relativeURL("assets/logo_x4.png", true);
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 = {
package/src/utils.ts CHANGED
@@ -186,6 +186,7 @@ export interface GirNamespaceMetadata {
186
186
  displayName?: string;
187
187
  description?: string;
188
188
  logoUrl?: string;
189
+ iconFile?: string;
189
190
  websiteUrl?: string;
190
191
  cDocsUrl?: string;
191
192
  license?: string;