typedoc-github-theme 0.1.2 → 0.2.1

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 KillerJulian
3
+ Copyright (c) 2024 Julian Wowra (development@julianwowra.de)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -6,7 +6,7 @@ This [TypeDoc](https://github.com/TypeStrong/typedoc) theme is designed to provi
6
6
 
7
7
  ## Example
8
8
 
9
- [![Example](./example.png)](https://killerjulian.github.io/typedoc-github-theme/)
9
+ [![Example](./example.png)](https://julianwowra.github.io/typedoc-github-theme/)
10
10
 
11
11
  ## Usage
12
12
 
@@ -38,10 +38,10 @@ npx typedoc src --plugin typedoc-github-theme
38
38
 
39
39
  ## Author
40
40
 
41
- 👤 **KillerJulian <info@killerjulian.de>**
41
+ 👤 **Julian Wowra <development@julianwowra.de>**
42
42
 
43
- - Github: [@KillerJulian](https://github.com/KillerJulian)
43
+ - Github: [@JulianWowra](https://github.com/JulianWowra)
44
44
 
45
45
  ## 🤝 Contributing
46
46
 
47
- Contributions, issues and feature requests are welcome!<br />Feel free to check the [issues page](https://github.com/KillerJulian/typedoc-github-theme/issues). You can also take a look at the [contributing guide](https://github.com/KillerJulian/typedoc-github-theme/blob/master/CONTRIBUTING.md).
47
+ Contributions, issues and feature requests are welcome!<br />Feel free to check the [issues page](https://github.com/JulianWowra/typedoc-github-theme/issues). You can also take a look at the [contributing guide](https://github.com/JulianWowra/typedoc-github-theme/blob/master/CONTRIBUTING.md).
@@ -1,24 +1,22 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GitHubTheme = void 0;
4
- const fs_1 = require("fs");
5
- const path_1 = require("path");
6
- const typedoc_1 = require("typedoc");
7
- const GitHubThemeContext_1 = require("./GitHubThemeContext");
8
- class GitHubTheme extends typedoc_1.DefaultTheme {
9
- initialize() {
10
- super.initialize();
1
+ import { cpSync } from 'fs';
2
+ import { dirname, resolve } from 'path';
3
+ import { DefaultTheme, JSX, RendererEvent } from 'typedoc';
4
+ import { fileURLToPath } from 'url';
5
+ import { GitHubThemeContext } from './GitHubThemeContext.js';
6
+ export class GitHubTheme extends DefaultTheme {
7
+ constructor(renderer) {
8
+ super(renderer);
11
9
  // copy the complete assets
12
- this.application.renderer.on(typedoc_1.RendererEvent.END, () => {
13
- const from = (0, path_1.resolve)(__dirname, '../src/assets/');
14
- const to = (0, path_1.resolve)(this.application.options.getValue('out'), 'assets/');
15
- (0, fs_1.cpSync)(from, to, { recursive: true });
10
+ renderer.on(RendererEvent.END, () => {
11
+ const from = resolve(dirname(fileURLToPath(import.meta.url)), '../src/assets/');
12
+ const to = resolve(this.application.options.getValue('out'), 'assets/');
13
+ cpSync(from, to, { recursive: true });
16
14
  });
17
15
  // link the css file
18
- this.application.renderer.hooks.on('head.end', (event) => (typedoc_1.JSX.createElement(typedoc_1.JSX.Fragment, null,
19
- typedoc_1.JSX.createElement("link", { rel: "stylesheet", href: event.relativeURL('assets/typedoc-github-style.css') }))));
16
+ renderer.hooks.on('head.end', (event) => (JSX.createElement(JSX.Fragment, null,
17
+ JSX.createElement("link", { rel: "stylesheet", href: event.relativeURL('assets/typedoc-github-style.css') }))));
20
18
  // set the Shiki theme
21
- this.application.on('bootstrapEnd', () => {
19
+ renderer.application.on('bootstrapEnd', () => {
22
20
  if (!this.application.options.isSet('lightHighlightTheme')) {
23
21
  this.application.options.setValue('lightHighlightTheme', 'github-light-default');
24
22
  }
@@ -28,7 +26,6 @@ class GitHubTheme extends typedoc_1.DefaultTheme {
28
26
  });
29
27
  }
30
28
  getRenderContext(pageEvent) {
31
- return new GitHubThemeContext_1.GitHubThemeContext(this, pageEvent, this.application.options);
29
+ return new GitHubThemeContext(this, pageEvent, this.application.options);
32
30
  }
33
31
  }
34
- exports.GitHubTheme = GitHubTheme;
@@ -1,9 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GitHubThemeContext = void 0;
4
- const typedoc_1 = require("typedoc");
5
- const footer_1 = require("./partials/footer");
6
- class GitHubThemeContext extends typedoc_1.DefaultThemeRenderContext {
7
- footer = () => (0, footer_1.footer)(this);
1
+ import { DefaultThemeRenderContext } from 'typedoc';
2
+ import { footer } from './partials/footer.js';
3
+ export class GitHubThemeContext extends DefaultThemeRenderContext {
4
+ footer = () => footer(this);
8
5
  }
9
- exports.GitHubThemeContext = GitHubThemeContext;
package/dist/index.js CHANGED
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.load = load;
4
- const GitHubTheme_1 = require("./GitHubTheme");
1
+ import { GitHubTheme } from './GitHubTheme.js';
5
2
  /**
6
3
  * Called by TypeDoc when loading this theme as a plugin
7
4
  */
8
- function load(app) {
9
- app.renderer.defineTheme('typedoc-github-theme', GitHubTheme_1.GitHubTheme);
5
+ export function load(app) {
6
+ app.renderer.defineTheme('typedoc-github-theme', GitHubTheme);
10
7
  app.on('bootstrapEnd', () => {
11
8
  if (app.options.isSet('theme') && app.options.getValue('theme') !== 'typedoc-github-theme') {
12
9
  return app.logger.warn(`The theme'typedoc-github-theme' is not used because another theme (${app.options.getValue('theme')}) was specified!`);
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.footer = footer;
4
- const typedoc_1 = require("typedoc");
5
- function footer(context) {
6
- return (typedoc_1.JSX.createElement("footer", null,
1
+ import { JSX } from 'typedoc';
2
+ export function footer(context) {
3
+ return (JSX.createElement("footer", null,
7
4
  context.hook('footer.begin', context),
8
5
  generatorDisplay(context),
9
6
  customFooterDisplay(context),
@@ -11,22 +8,22 @@ function footer(context) {
11
8
  }
12
9
  function generatorDisplay(context) {
13
10
  if (context.options.getValue('hideGenerator')) {
14
- return typedoc_1.JSX.createElement(typedoc_1.JSX.Fragment, null);
11
+ return JSX.createElement(JSX.Fragment, null);
15
12
  }
16
- return (typedoc_1.JSX.createElement("p", { class: "tsd-generator" },
13
+ return (JSX.createElement("p", { class: "tsd-generator" },
17
14
  'Generated using ',
18
- typedoc_1.JSX.createElement("a", { href: "https://typedoc.org/", target: "_blank" }, "TypeDoc"),
15
+ JSX.createElement("a", { href: "https://typedoc.org/", target: "_blank" }, "TypeDoc"),
19
16
  ' with ',
20
- typedoc_1.JSX.createElement("a", { href: "https://github.com/KillerJulian/typedoc-github-theme", target: "_blank" }, "typedoc-github-theme")));
17
+ JSX.createElement("a", { href: "https://github.com/JulianWowra/typedoc-github-theme", target: "_blank" }, "typedoc-github-theme")));
21
18
  }
22
19
  function customFooterDisplay(context) {
23
20
  const customFooterHtml = context.options.getValue('customFooterHtml');
24
21
  if (!customFooterHtml) {
25
- return typedoc_1.JSX.createElement(typedoc_1.JSX.Fragment, null);
22
+ return JSX.createElement(JSX.Fragment, null);
26
23
  }
27
24
  if (context.options.getValue('customFooterHtmlDisableWrapper')) {
28
- return typedoc_1.JSX.createElement(typedoc_1.JSX.Raw, { html: customFooterHtml });
25
+ return JSX.createElement(JSX.Raw, { html: customFooterHtml });
29
26
  }
30
- return (typedoc_1.JSX.createElement("p", null,
31
- typedoc_1.JSX.createElement(typedoc_1.JSX.Raw, { html: customFooterHtml })));
27
+ return (JSX.createElement("p", null,
28
+ JSX.createElement(JSX.Raw, { html: customFooterHtml })));
32
29
  }
package/package.json CHANGED
@@ -1,26 +1,30 @@
1
1
  {
2
2
  "name": "typedoc-github-theme",
3
3
  "description": "Elegant and seamless look and feel for your TypeScript documentation on GitHub Pages",
4
- "version": "0.1.2",
4
+ "version": "0.2.1",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
- "repository": "https://github.com/KillerJulian/typedoc-github-theme",
8
- "homepage": "https://killerjulian.github.io/typedoc-github-theme/",
9
- "author": "KillerJulian <info@killerjulian.de>",
7
+ "type": "module",
8
+ "repository": "https://github.com/JulianWowra/typedoc-github-theme",
9
+ "homepage": "https://julianwowra.github.io/typedoc-github-theme/",
10
+ "author": "Julian Wowra <development@julianwowra.de>",
10
11
  "license": "MIT",
11
- "packageManager": "pnpm@9.6.0",
12
+ "publishConfig": {
13
+ "provenance": true
14
+ },
15
+ "packageManager": "pnpm@9.15.2",
12
16
  "dependencies": {},
13
17
  "peerDependencies": {
14
- "typedoc": "^0.26.0"
18
+ "typedoc": "^0.27.6"
15
19
  },
16
20
  "devDependencies": {
17
- "@types/node": "^18.19.43",
18
- "eslint": "9.8.0",
21
+ "@types/node": "^18.19.69",
22
+ "eslint": "9.17.0",
19
23
  "eslint-config-prettier": "9.1.0",
20
- "prettier": "3.3.3",
21
- "typedoc": "~0.26.5",
22
- "typescript": "5.5.4",
23
- "typescript-eslint": "8.0.0"
24
+ "prettier": "3.4.2",
25
+ "typedoc": "~0.27.6",
26
+ "typescript": "5.7.2",
27
+ "typescript-eslint": "8.19.0"
24
28
  },
25
29
  "scripts": {
26
30
  "build": "pnpm build:lib && pnpm build:docs",
@@ -8,31 +8,43 @@
8
8
  --light-color-background-secondary: #f6f8fa;
9
9
  --light-color-background-navbar: #f6f8fa;
10
10
 
11
- --light-color-accent: #d0d7de;
11
+ --light-color-accent: #eff2f5;
12
12
 
13
13
  --light-color-text: #1f2328;
14
- --light-color-text-aside: #636c76;
14
+ --light-color-text-aside: #59636e;
15
15
 
16
16
  --light-color-link: #0969da;
17
17
 
18
18
  --light-color-warning-border: #f7ebba;
19
19
  --light-color-background-warning: #fff8c5;
20
20
 
21
+ --light-color-alert-note: #0969da;
22
+ --light-color-alert-tip: #1a7f37;
23
+ --light-color-alert-important: #8250df;
24
+ --light-color-alert-warning: #9a6700;
25
+ --light-color-alert-caution: #cf222e;
26
+
21
27
  /* GitHub "Dark default" */
22
28
  --dark-color-background: #0d1117;
23
- --dark-color-background-secondary: #161b22;
24
- --dark-color-background-navbar: #000000;
29
+ --dark-color-background-secondary: #151b23;
30
+ --dark-color-background-navbar: #010409;
25
31
 
26
- --dark-color-accent: #30363d;
32
+ --dark-color-accent: #262c36;
27
33
 
28
- --dark-color-text: #e6edf3;
29
- --dark-color-text-aside: #8d96a0;
34
+ --dark-color-text: #f0f6fc;
35
+ --dark-color-text-aside: #9198a1;
30
36
 
31
37
  --dark-color-link: #4493f8;
32
38
 
33
39
  --dark-color-warning-border: #3a2d12;
34
40
  --dark-color-background-warning: #282215;
35
41
 
42
+ --dark-color-alert-note: #1f6feb;
43
+ --dark-color-alert-tip: #238636;
44
+ --dark-color-alert-important: #8957e5;
45
+ --dark-color-alert-warning: #9e6a03;
46
+ --dark-color-alert-caution: #da3633;
47
+
36
48
  /* Link colors */
37
49
  --color-warning-text: var(--color-text);
38
50
  --color-icon-background: var(--color-background);
@@ -95,49 +107,45 @@ h6 {
95
107
  * Links
96
108
  */
97
109
 
98
- a,
110
+ .tsd-accordion-details a,
111
+ .tsd-accordion a,
112
+ .tsd-page-toolbar a.title {
113
+ color: var(--color-text);
114
+ text-decoration: none;
115
+ }
116
+
117
+ .tsd-accordion-details a:hover,
118
+ .tsd-page-toolbar a.title:hover,
119
+ .tsd-accordion a:hover,
120
+ .tsd-anchor-icon {
121
+ color: var(--color-text-aside);
122
+ }
123
+
99
124
  .tsd-kind-class {
100
125
  color: var(--color-link);
101
126
  text-decoration: underline;
127
+ text-underline-offset: 3px;
102
128
  }
103
129
 
104
- .tsd-index-link {
130
+ .tsd-index-link,
131
+ .tsd-page-navigation a:hover {
105
132
  text-decoration: none;
106
133
  }
107
134
 
108
135
  .tsd-index-link:hover {
109
136
  text-decoration: underline;
137
+ text-underline-offset: 3px;
110
138
  }
111
139
 
112
- .tsd-sources a {
140
+ a code,
141
+ .tsd-sources a,
142
+ .tsd-page-navigation a:hover {
113
143
  color: var(--color-link);
114
144
  }
115
145
 
116
- /*
117
- * Lists
118
- */
119
-
120
- ul,
121
- ol {
122
- margin-left: 20px;
123
- list-style: disc;
124
- }
125
-
126
- li::marker {
127
- color: var(--color-accent);
128
- }
129
-
130
- /*
131
- * Input fields
132
- */
133
-
134
- input {
135
- background-color: var(--color-background-secondary);
136
- color: var(--color-text);
137
- border: 1px solid var(--color-accent);
138
- border-radius: 6px;
139
- padding: 8px;
140
- width: 100%;
146
+ a.external[target='_blank'] {
147
+ background-image: none;
148
+ padding-right: 0px;
141
149
  }
142
150
 
143
151
  /*
@@ -277,10 +285,6 @@ code.tsd-tag {
277
285
  border-bottom-color: var(--color-accent);
278
286
  }
279
287
 
280
- .tsd-page-toolbar a.title:hover {
281
- text-decoration: none;
282
- }
283
-
284
288
  #tsd-search.has-focus {
285
289
  background-color: var(--color-background-navbar);
286
290
  }
@@ -295,6 +299,10 @@ code.tsd-tag {
295
299
  margin-bottom: 0px;
296
300
  }
297
301
 
302
+ #tsd-search .results li a {
303
+ color: var(--color-text);
304
+ }
305
+
298
306
  #tsd-search .results li:hover:not(.no-results) {
299
307
  background-color: var(--color-accent);
300
308
  }
@@ -404,12 +412,12 @@ footer p {
404
412
  * Fix collapsed margin
405
413
  */
406
414
 
407
- .tsd-accordion-summary.tsd-index-summary > h5 {
415
+ .tsd-accordion-summary > h3 {
408
416
  margin-top: 0px;
409
417
  margin-bottom: 0px;
410
418
  }
411
419
 
412
- .tsd-panel-group:not([open]) > .tsd-accordion-summary {
420
+ .tsd-page-navigation:not([open]) > .tsd-accordion-summary {
413
421
  margin-bottom: 0px;
414
422
  }
415
423
 
@@ -417,19 +425,6 @@ footer p {
417
425
  * Fix collapse arrow position
418
426
  */
419
427
 
420
- .tsd-accordion-summary:has(svg) > * {
421
- display: inline-flex;
422
- align-items: center;
423
- line-height: normal;
424
- }
425
-
426
- .tsd-accordion-summary > * > svg {
427
- padding-top: 0px;
428
- position: relative;
429
- left: 0px;
430
- top: 50%;
431
- }
432
-
433
428
  .tsd-accordion-summary svg {
434
429
  transition: transform 0.1s ease-in-out;
435
430
  }