varvara-typedoc-theme 0.3.4 → 0.3.6
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/README.md +21 -4
- package/assets/overrides.css +13 -0
- package/dist/index.js +108 -103
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Varvara TypeDoc Theme
|
|
1
|
+
# Varvara 🤦♀️ TypeDoc Theme
|
|
2
2
|
|
|
3
|
-
_View a_ [_live example here_](https://
|
|
3
|
+
_View a_ [_live example here_](https://docs.label.energy).
|
|
4
4
|
|
|
5
5
|
Varvara TypeDoc Theme is a custom theme for TypeDoc, designed to provide a seamless documentation experience for TypeScript projects.
|
|
6
6
|
|
|
@@ -8,6 +8,18 @@ Varvara TypeDoc Theme is a custom theme for TypeDoc, designed to provide a seaml
|
|
|
8
8
|
[](https://github.com/marcmarine/varvara-js/blob/main/LICENSE)
|
|
9
9
|
[](https://github.com/marcmarine/varvara-js/blob/main/packages/typedoc-theme/CHANGELOG.md)
|
|
10
10
|
|
|
11
|
+
<details close>
|
|
12
|
+
<summary>🖼️ <strong>Screenshots</strong></summary>
|
|
13
|
+
|
|
14
|
+

|
|
15
|
+
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
> [!TIP]
|
|
19
|
+
> The theme is [fully customizable](#customization) 🚀.
|
|
20
|
+
|
|
21
|
+
</details>
|
|
22
|
+
|
|
11
23
|
## Installation
|
|
12
24
|
|
|
13
25
|
Ensure TypeDoc is [installed](https://typedoc.org/index.html#quick-start) in your project.
|
|
@@ -30,7 +42,7 @@ npx typedoc --plugin varvara-typedoc-theme --theme varvara-css src/index.ts
|
|
|
30
42
|
|
|
31
43
|
### Method 2: Configuration File
|
|
32
44
|
|
|
33
|
-
Create a `typedoc.
|
|
45
|
+
Create a `typedoc.mjs` configuration file in your project's root directory:
|
|
34
46
|
|
|
35
47
|
> [!NOTE]
|
|
36
48
|
> You can use various TypeDoc [configuration files](https://typedoc.org/documents/Options.Configuration.html) to customize your documentation generation.
|
|
@@ -45,7 +57,12 @@ const config = {
|
|
|
45
57
|
theme: 'varvara-css',
|
|
46
58
|
|
|
47
59
|
// Optional: Include version information
|
|
48
|
-
includeVersion: true
|
|
60
|
+
includeVersion: true,
|
|
61
|
+
|
|
62
|
+
// Optional: Include groups
|
|
63
|
+
navigation: {
|
|
64
|
+
includeGroups: true
|
|
65
|
+
}
|
|
49
66
|
|
|
50
67
|
// Additional TypeDoc configuration options
|
|
51
68
|
// ... other options as needed
|
package/assets/overrides.css
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--va-link-color: var(--va-color-primary);
|
|
3
|
+
--va-collapse-tree-indentation: var(--va-space-4);
|
|
4
|
+
--va-space-ratio: 0.78;
|
|
3
5
|
}
|
|
4
6
|
|
|
5
7
|
[data-theme='light'] {
|
|
@@ -23,6 +25,17 @@
|
|
|
23
25
|
align-items: center;
|
|
24
26
|
}
|
|
25
27
|
|
|
28
|
+
.va-button span {
|
|
29
|
+
color: inherit;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.va-button span,
|
|
33
|
+
.va-collapse summary {
|
|
34
|
+
white-space: nowrap;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
text-overflow: ellipsis;
|
|
37
|
+
}
|
|
38
|
+
|
|
26
39
|
.title {
|
|
27
40
|
flex: 1;
|
|
28
41
|
}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createRequire } from "node:module";
|
|
|
2
2
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
3
3
|
|
|
4
4
|
// src/themes/VarvaraTheme.tsx
|
|
5
|
-
import { DefaultTheme as DefaultTheme2, JSX as
|
|
5
|
+
import { DefaultTheme as DefaultTheme2, JSX as JSX5, RendererEvent } from "typedoc";
|
|
6
6
|
import * as path from "path";
|
|
7
7
|
import * as fs from "fs";
|
|
8
8
|
import { fileURLToPath } from "url";
|
|
@@ -56,37 +56,11 @@ function footer(context) {
|
|
|
56
56
|
}, context.hook("footer.begin", context), generatorDisplay, customFooterDisplay, context.hook("footer.end", context)));
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
// src/partials/sidebar.tsx
|
|
60
|
-
import { i18n as i18n2, JSX as JSX2 } from "typedoc";
|
|
61
|
-
function sidebar(context) {
|
|
62
|
-
const navigation = context.getNavigation();
|
|
63
|
-
return (props) => {
|
|
64
|
-
return /* @__PURE__ */ JSX2.createElement("nav", {
|
|
65
|
-
class: "va-button-group"
|
|
66
|
-
}, /* @__PURE__ */ JSX2.createElement("details", {
|
|
67
|
-
class: "va-collapse tsd-accordion"
|
|
68
|
-
}, /* @__PURE__ */ JSX2.createElement("summary", null, /* @__PURE__ */ JSX2.createElement("a", {
|
|
69
|
-
href: context.urlTo(props.project)
|
|
70
|
-
}, i18n2.kind_plural_module())), navigation.map((item) => /* @__PURE__ */ JSX2.createElement("a", {
|
|
71
|
-
href: `${context.relativeURL("./")}/${item.path}`,
|
|
72
|
-
class: ["va-button", item.path?.includes(props.url) && "va-button--active"].join(" ")
|
|
73
|
-
}, /* @__PURE__ */ JSX2.createElement("svg", {
|
|
74
|
-
width: "20",
|
|
75
|
-
height: "20",
|
|
76
|
-
viewBox: "0 0 24 24",
|
|
77
|
-
fill: "none",
|
|
78
|
-
class: "tsd-kind-icon"
|
|
79
|
-
}, /* @__PURE__ */ JSX2.createElement("use", {
|
|
80
|
-
href: `#icon-${item.kind}`
|
|
81
|
-
})), item.text))));
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
|
|
85
59
|
// src/partials/navigation.tsx
|
|
86
|
-
import { JSX as
|
|
60
|
+
import { JSX as JSX2, ReflectionFlag, i18n as i18n2, translateTagName, ReflectionFlags } from "typedoc";
|
|
87
61
|
function pageSidebar(context) {
|
|
88
62
|
return (props) => {
|
|
89
|
-
return /* @__PURE__ */
|
|
63
|
+
return /* @__PURE__ */ JSX2.createElement("div", {
|
|
90
64
|
class: "va-button-group"
|
|
91
65
|
}, context.settings(), context.pageNavigation(props));
|
|
92
66
|
};
|
|
@@ -109,33 +83,33 @@ function settings(context) {
|
|
|
109
83
|
visibilityOptions.push(buildFilterItem(context, key, ReflectionFlags.flagString(flagOptionNameToReflectionFlag[key]), defaultFilters[key]));
|
|
110
84
|
}
|
|
111
85
|
}
|
|
112
|
-
return /* @__PURE__ */
|
|
86
|
+
return /* @__PURE__ */ JSX2.createElement("details", {
|
|
113
87
|
class: "va-collapse settings tsd-accordion",
|
|
114
88
|
open: false
|
|
115
|
-
}, /* @__PURE__ */
|
|
89
|
+
}, /* @__PURE__ */ JSX2.createElement("summary", null, i18n2.theme_settings()), visibilityOptions.length && /* @__PURE__ */ JSX2.createElement("details", {
|
|
116
90
|
class: "va-collapse"
|
|
117
|
-
}, /* @__PURE__ */
|
|
91
|
+
}, /* @__PURE__ */ JSX2.createElement("summary", null, i18n2.theme_member_visibility()), ...visibilityOptions), /* @__PURE__ */ JSX2.createElement("label", null, /* @__PURE__ */ JSX2.createElement("span", null, i18n2.theme_theme()), /* @__PURE__ */ JSX2.createElement("select", {
|
|
118
92
|
id: "tsd-theme",
|
|
119
93
|
class: "va-select"
|
|
120
|
-
}, /* @__PURE__ */
|
|
94
|
+
}, /* @__PURE__ */ JSX2.createElement("option", {
|
|
121
95
|
value: "os"
|
|
122
|
-
},
|
|
96
|
+
}, i18n2.theme_os()), /* @__PURE__ */ JSX2.createElement("option", {
|
|
123
97
|
value: "light"
|
|
124
|
-
},
|
|
98
|
+
}, i18n2.theme_light()), /* @__PURE__ */ JSX2.createElement("option", {
|
|
125
99
|
value: "dark"
|
|
126
|
-
},
|
|
100
|
+
}, i18n2.theme_dark()))));
|
|
127
101
|
};
|
|
128
102
|
}
|
|
129
103
|
function buildSectionNavigation(context, headings) {
|
|
130
104
|
const levels = [[]];
|
|
131
|
-
const PADDING_PER_LEVEL =
|
|
105
|
+
const PADDING_PER_LEVEL = 12;
|
|
132
106
|
function finalizeLevel(finishedHandlingHeadings) {
|
|
133
107
|
const level = levels.pop();
|
|
134
108
|
if (levels[levels.length - 1].length === 0 && finishedHandlingHeadings) {
|
|
135
109
|
levels[levels.length - 1] = level;
|
|
136
110
|
return;
|
|
137
111
|
}
|
|
138
|
-
const built = /* @__PURE__ */
|
|
112
|
+
const built = /* @__PURE__ */ JSX2.createElement(JSX2.Fragment, null, level.map((l) => /* @__PURE__ */ JSX2.createElement(JSX2.Fragment, null, l)));
|
|
139
113
|
levels[levels.length - 1].push(built);
|
|
140
114
|
}
|
|
141
115
|
for (const heading of headings) {
|
|
@@ -146,11 +120,12 @@ function buildSectionNavigation(context, headings) {
|
|
|
146
120
|
while (inferredLevel > levels.length) {
|
|
147
121
|
levels.push([]);
|
|
148
122
|
}
|
|
149
|
-
|
|
123
|
+
const icon = heading.kind && context.icons[heading.kind]();
|
|
124
|
+
levels[levels.length - 1].push(/* @__PURE__ */ JSX2.createElement("a", {
|
|
150
125
|
href: heading.link,
|
|
151
126
|
class: [heading.classes, "va-button"].join(" "),
|
|
152
|
-
style: `padding-left: ${PADDING_PER_LEVEL * (inferredLevel - 1)}px`
|
|
153
|
-
},
|
|
127
|
+
style: !icon ? `padding-left: ${PADDING_PER_LEVEL * (inferredLevel - 1)}px` : ""
|
|
128
|
+
}, icon, /* @__PURE__ */ JSX2.createElement("span", null, heading.text)));
|
|
154
129
|
}
|
|
155
130
|
while (levels.length > 1) {
|
|
156
131
|
finalizeLevel(true);
|
|
@@ -160,9 +135,9 @@ function buildSectionNavigation(context, headings) {
|
|
|
160
135
|
return levels[0];
|
|
161
136
|
}
|
|
162
137
|
function buildFilterItem(_context, name, displayName, defaultValue) {
|
|
163
|
-
return /* @__PURE__ */
|
|
138
|
+
return /* @__PURE__ */ JSX2.createElement("label", {
|
|
164
139
|
class: "tsd-filter-item"
|
|
165
|
-
}, /* @__PURE__ */
|
|
140
|
+
}, /* @__PURE__ */ JSX2.createElement("span", null, displayName), /* @__PURE__ */ JSX2.createElement("input", {
|
|
166
141
|
class: "tsd-filter-input va-checkbox",
|
|
167
142
|
type: "checkbox",
|
|
168
143
|
id: `tsd-filter-${name}`,
|
|
@@ -173,47 +148,77 @@ function buildFilterItem(_context, name, displayName, defaultValue) {
|
|
|
173
148
|
function pageNavigation(context) {
|
|
174
149
|
return (props) => {
|
|
175
150
|
if (!props.pageSections.some((sect) => sect.headings.length)) {
|
|
176
|
-
return /* @__PURE__ */
|
|
151
|
+
return /* @__PURE__ */ JSX2.createElement(JSX2.Fragment, null);
|
|
177
152
|
}
|
|
178
153
|
const sections = [];
|
|
179
154
|
for (const section of props.pageSections) {
|
|
180
155
|
if (section.title) {
|
|
181
|
-
sections.push(/* @__PURE__ */
|
|
156
|
+
sections.push(/* @__PURE__ */ JSX2.createElement("details", {
|
|
182
157
|
open: true,
|
|
183
158
|
class: "va-collapse tsd-accordion"
|
|
184
|
-
}, /* @__PURE__ */
|
|
159
|
+
}, /* @__PURE__ */ JSX2.createElement("summary", {
|
|
185
160
|
"data-key": `section-${section.title}`
|
|
186
161
|
}, section.title), buildSectionNavigation(context, section.headings)));
|
|
187
162
|
} else {
|
|
188
163
|
sections.push(buildSectionNavigation(context, section.headings));
|
|
189
164
|
}
|
|
190
165
|
}
|
|
191
|
-
return /* @__PURE__ */
|
|
166
|
+
return /* @__PURE__ */ JSX2.createElement("details", {
|
|
192
167
|
open: false,
|
|
193
168
|
class: "va-collapse page-navigation tsd-accordion"
|
|
194
|
-
}, /* @__PURE__ */
|
|
169
|
+
}, /* @__PURE__ */ JSX2.createElement("summary", null, i18n2.theme_on_this_page()), sections);
|
|
195
170
|
};
|
|
196
171
|
}
|
|
172
|
+
var navigation = (context) => (props) => {
|
|
173
|
+
const navigationData = context.getNavigation();
|
|
174
|
+
return /* @__PURE__ */ JSX2.createElement("nav", {
|
|
175
|
+
class: "va-button-group"
|
|
176
|
+
}, /* @__PURE__ */ JSX2.createElement(Navigation, {
|
|
177
|
+
data: navigationData,
|
|
178
|
+
context
|
|
179
|
+
}));
|
|
180
|
+
};
|
|
181
|
+
var Navigation = ({ data, context }) => /* @__PURE__ */ JSX2.createElement(JSX2.Fragment, null, data.map((item) => item.children && item.children.length > 0 ? /* @__PURE__ */ JSX2.createElement("details", {
|
|
182
|
+
class: "va-collapse tsd-accordion"
|
|
183
|
+
}, /* @__PURE__ */ JSX2.createElement("summary", {
|
|
184
|
+
class: "tsd-accordion-summary",
|
|
185
|
+
"data-key": `section-${item.text}`
|
|
186
|
+
}, item.kind && context.icons[item.kind](), item.text), /* @__PURE__ */ JSX2.createElement(Navigation, {
|
|
187
|
+
data: item.children,
|
|
188
|
+
context
|
|
189
|
+
})) : /* @__PURE__ */ JSX2.createElement(Item, {
|
|
190
|
+
item,
|
|
191
|
+
context
|
|
192
|
+
})));
|
|
193
|
+
var Item = ({ item, context }) => {
|
|
194
|
+
const icon = item.kind && context.icons[item.kind]();
|
|
195
|
+
return item.path ? /* @__PURE__ */ JSX2.createElement("a", {
|
|
196
|
+
href: context.relativeURL(item.path),
|
|
197
|
+
class: "va-button"
|
|
198
|
+
}, icon, /* @__PURE__ */ JSX2.createElement("span", null, item.text)) : /* @__PURE__ */ JSX2.createElement("span", {
|
|
199
|
+
class: "va-button"
|
|
200
|
+
}, icon, /* @__PURE__ */ JSX2.createElement("span", null, item.text));
|
|
201
|
+
};
|
|
197
202
|
|
|
198
203
|
// src/partials/toolbar.tsx
|
|
199
|
-
import { i18n as
|
|
204
|
+
import { i18n as i18n3, DeclarationReflection, JSX as JSX3, ProjectReflection } from "typedoc";
|
|
200
205
|
function toolbar(context) {
|
|
201
|
-
return (props) => /* @__PURE__ */
|
|
206
|
+
return (props) => /* @__PURE__ */ JSX3.createElement("header", {
|
|
202
207
|
class: "page-toolbar"
|
|
203
|
-
}, /* @__PURE__ */
|
|
208
|
+
}, /* @__PURE__ */ JSX3.createElement("div", {
|
|
204
209
|
class: "va-button-group"
|
|
205
|
-
}, /* @__PURE__ */
|
|
210
|
+
}, /* @__PURE__ */ JSX3.createElement("div", {
|
|
206
211
|
class: "va-button-group va-button-group--horizontal"
|
|
207
|
-
}, /* @__PURE__ */
|
|
212
|
+
}, /* @__PURE__ */ JSX3.createElement("a", {
|
|
208
213
|
href: context.options.getValue("titleLink") || context.relativeURL("index.html"),
|
|
209
214
|
class: "title va-button"
|
|
210
|
-
}, /* @__PURE__ */
|
|
215
|
+
}, /* @__PURE__ */ JSX3.createElement("b", null, props.project.name), (props.project instanceof DeclarationReflection || props.project instanceof ProjectReflection) && props.project.packageVersion && /* @__PURE__ */ JSX3.createElement("span", {
|
|
211
216
|
class: "version-badge"
|
|
212
|
-
}, "v", props.project.packageVersion)), /* @__PURE__ */
|
|
217
|
+
}, "v", props.project.packageVersion)), /* @__PURE__ */ JSX3.createElement("button", {
|
|
213
218
|
id: "tsd-search-trigger",
|
|
214
219
|
class: "va-button",
|
|
215
|
-
"aria-label":
|
|
216
|
-
}, /* @__PURE__ */
|
|
220
|
+
"aria-label": i18n3.theme_search()
|
|
221
|
+
}, /* @__PURE__ */ JSX3.createElement("svg", {
|
|
217
222
|
xmlns: "http://www.w3.org/2000/svg",
|
|
218
223
|
fill: "none",
|
|
219
224
|
viewBox: "0 0 24 24",
|
|
@@ -221,15 +226,15 @@ function toolbar(context) {
|
|
|
221
226
|
width: "16",
|
|
222
227
|
height: "16",
|
|
223
228
|
stroke: "currentColor"
|
|
224
|
-
}, /* @__PURE__ */
|
|
229
|
+
}, /* @__PURE__ */ JSX3.createElement("path", {
|
|
225
230
|
d: "m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"
|
|
226
|
-
}))), /* @__PURE__ */
|
|
231
|
+
}))), /* @__PURE__ */ JSX3.createElement("a", {
|
|
227
232
|
href: "#",
|
|
228
233
|
class: "va-button",
|
|
229
234
|
id: "tsd-toolbar-menu-trigger",
|
|
230
235
|
"data-toggle": "menu",
|
|
231
|
-
"aria-label":
|
|
232
|
-
}, /* @__PURE__ */
|
|
236
|
+
"aria-label": i18n3.theme_menu()
|
|
237
|
+
}, /* @__PURE__ */ JSX3.createElement("svg", {
|
|
233
238
|
xmlns: "http://www.w3.org/2000/svg",
|
|
234
239
|
fill: "none",
|
|
235
240
|
viewBox: "0 0 24 24",
|
|
@@ -237,28 +242,28 @@ function toolbar(context) {
|
|
|
237
242
|
width: "16",
|
|
238
243
|
height: "16",
|
|
239
244
|
stroke: "currentColor"
|
|
240
|
-
}, /* @__PURE__ */
|
|
245
|
+
}, /* @__PURE__ */ JSX3.createElement("path", {
|
|
241
246
|
d: "M3.75 9h16.5m-16.5 6.75h16.5"
|
|
242
|
-
})))), /* @__PURE__ */
|
|
247
|
+
})))), /* @__PURE__ */ JSX3.createElement("div", {
|
|
243
248
|
class: "navigation-links va-button-group"
|
|
244
|
-
}, Object.entries(context.options.getValue("navigationLinks")).map(([label, url]) => /* @__PURE__ */
|
|
249
|
+
}, Object.entries(context.options.getValue("navigationLinks")).map(([label, url]) => /* @__PURE__ */ JSX3.createElement("a", {
|
|
245
250
|
href: url,
|
|
246
251
|
class: "va-button"
|
|
247
|
-
}, /* @__PURE__ */
|
|
252
|
+
}, /* @__PURE__ */ JSX3.createElement("span", null, label), /* @__PURE__ */ JSX3.createElement("svg", {
|
|
248
253
|
viewBox: "0 0 16 16",
|
|
249
254
|
xmlns: "http://www.w3.org/2000/svg",
|
|
250
255
|
width: "16",
|
|
251
256
|
height: "16",
|
|
252
257
|
fill: "none"
|
|
253
|
-
}, /* @__PURE__ */
|
|
258
|
+
}, /* @__PURE__ */ JSX3.createElement("path", {
|
|
254
259
|
"fill-rule": "evenodd",
|
|
255
260
|
"clip-rule": "evenodd",
|
|
256
261
|
d: "M1.52346 0.380859H15.6187V14.4761H13.333V4.28282L2.33158 15.2842L0.715332 13.668L11.7167 2.66657H1.52346V0.380859Z",
|
|
257
262
|
fill: "currentColor"
|
|
258
|
-
})))))), /* @__PURE__ */
|
|
263
|
+
})))))), /* @__PURE__ */ JSX3.createElement("dialog", {
|
|
259
264
|
id: "tsd-search",
|
|
260
|
-
"aria-label":
|
|
261
|
-
}, /* @__PURE__ */
|
|
265
|
+
"aria-label": i18n3.theme_search()
|
|
266
|
+
}, /* @__PURE__ */ JSX3.createElement("input", {
|
|
262
267
|
role: "combobox",
|
|
263
268
|
class: "va-input",
|
|
264
269
|
id: "tsd-search-input",
|
|
@@ -268,21 +273,21 @@ function toolbar(context) {
|
|
|
268
273
|
spellcheck: false,
|
|
269
274
|
autocapitalize: "off",
|
|
270
275
|
autocomplete: "off",
|
|
271
|
-
placeholder:
|
|
276
|
+
placeholder: i18n3.theme_search_placeholder(),
|
|
272
277
|
maxLength: 100
|
|
273
|
-
}), /* @__PURE__ */
|
|
278
|
+
}), /* @__PURE__ */ JSX3.createElement("ul", {
|
|
274
279
|
role: "listbox",
|
|
275
280
|
id: "tsd-search-results"
|
|
276
|
-
}), /* @__PURE__ */
|
|
281
|
+
}), /* @__PURE__ */ JSX3.createElement("div", {
|
|
277
282
|
id: "tsd-search-status",
|
|
278
283
|
"aria-live": "polite",
|
|
279
284
|
"aria-atomic": "true"
|
|
280
|
-
}, /* @__PURE__ */
|
|
285
|
+
}, /* @__PURE__ */ JSX3.createElement("div", null, i18n3.theme_preparing_search_index()))));
|
|
281
286
|
}
|
|
282
287
|
|
|
283
288
|
// src/partials/layout.tsx
|
|
284
289
|
import { extname } from "path";
|
|
285
|
-
import { JSX as
|
|
290
|
+
import { JSX as JSX4 } from "typedoc";
|
|
286
291
|
|
|
287
292
|
// src/utils.ts
|
|
288
293
|
import {
|
|
@@ -327,65 +332,65 @@ function getHierarchyRoots(project) {
|
|
|
327
332
|
|
|
328
333
|
// src/partials/layout.tsx
|
|
329
334
|
function layout(context) {
|
|
330
|
-
return (template, props) => /* @__PURE__ */
|
|
335
|
+
return (template, props) => /* @__PURE__ */ JSX4.createElement("html", {
|
|
331
336
|
class: "default",
|
|
332
337
|
lang: context.options.getValue("lang"),
|
|
333
338
|
"data-base": context.relativeURL("./")
|
|
334
|
-
}, /* @__PURE__ */
|
|
339
|
+
}, /* @__PURE__ */ JSX4.createElement("head", null, /* @__PURE__ */ JSX4.createElement("meta", {
|
|
335
340
|
charset: "utf-8"
|
|
336
|
-
}), context.hook("head.begin", context), /* @__PURE__ */
|
|
341
|
+
}), context.hook("head.begin", context), /* @__PURE__ */ JSX4.createElement("meta", {
|
|
337
342
|
"http-equiv": "x-ua-compatible",
|
|
338
343
|
content: "IE=edge"
|
|
339
|
-
}), /* @__PURE__ */
|
|
344
|
+
}), /* @__PURE__ */ JSX4.createElement("title", null, props.model.isProject() ? getDisplayName(props.model) : `${getDisplayName(props.model)} | ${getDisplayName(props.project)}`), favicon(context), props.url === "index.html" && buildSiteMetadata(context), /* @__PURE__ */ JSX4.createElement("meta", {
|
|
340
345
|
name: "description",
|
|
341
346
|
content: "Documentation for " + props.project.name
|
|
342
|
-
}), /* @__PURE__ */
|
|
347
|
+
}), /* @__PURE__ */ JSX4.createElement("meta", {
|
|
343
348
|
name: "viewport",
|
|
344
349
|
content: "width=device-width, initial-scale=1"
|
|
345
|
-
}), /* @__PURE__ */
|
|
350
|
+
}), /* @__PURE__ */ JSX4.createElement("link", {
|
|
346
351
|
rel: "stylesheet",
|
|
347
352
|
href: context.relativeURL("assets/style.css", true)
|
|
348
|
-
}), /* @__PURE__ */
|
|
353
|
+
}), /* @__PURE__ */ JSX4.createElement("link", {
|
|
349
354
|
rel: "stylesheet",
|
|
350
355
|
href: context.relativeURL("assets/highlight.css", true)
|
|
351
|
-
}), /* @__PURE__ */
|
|
356
|
+
}), /* @__PURE__ */ JSX4.createElement("script", {
|
|
352
357
|
defer: true,
|
|
353
358
|
src: context.relativeURL("assets/main.js", true)
|
|
354
|
-
}), /* @__PURE__ */
|
|
359
|
+
}), /* @__PURE__ */ JSX4.createElement("script", {
|
|
355
360
|
async: true,
|
|
356
361
|
src: context.relativeURL("assets/icons.js", true),
|
|
357
362
|
id: "tsd-icons-script"
|
|
358
|
-
}), /* @__PURE__ */
|
|
363
|
+
}), /* @__PURE__ */ JSX4.createElement("script", {
|
|
359
364
|
async: true,
|
|
360
365
|
src: context.relativeURL("assets/search.js", true),
|
|
361
366
|
id: "tsd-search-script"
|
|
362
|
-
}), /* @__PURE__ */
|
|
367
|
+
}), /* @__PURE__ */ JSX4.createElement("script", {
|
|
363
368
|
async: true,
|
|
364
369
|
src: context.relativeURL("assets/navigation.js", true),
|
|
365
370
|
id: "tsd-nav-script"
|
|
366
|
-
}), !!getHierarchyRoots(props.project).length && /* @__PURE__ */
|
|
371
|
+
}), !!getHierarchyRoots(props.project).length && /* @__PURE__ */ JSX4.createElement("script", {
|
|
367
372
|
async: true,
|
|
368
373
|
src: context.relativeURL("assets/hierarchy.js", true),
|
|
369
374
|
id: "tsd-hierarchy-script"
|
|
370
|
-
}), context.hook("head.end", context), context.options.getValue("customCss") && /* @__PURE__ */
|
|
375
|
+
}), context.hook("head.end", context), context.options.getValue("customCss") && /* @__PURE__ */ JSX4.createElement("link", {
|
|
371
376
|
rel: "stylesheet",
|
|
372
377
|
href: context.relativeURL("assets/custom.css", true)
|
|
373
|
-
}), context.options.getValue("customJs") && /* @__PURE__ */
|
|
378
|
+
}), context.options.getValue("customJs") && /* @__PURE__ */ JSX4.createElement("script", {
|
|
374
379
|
defer: true,
|
|
375
380
|
src: context.relativeURL("assets/custom.js", true)
|
|
376
|
-
})), /* @__PURE__ */
|
|
381
|
+
})), /* @__PURE__ */ JSX4.createElement("body", null, context.hook("body.begin", context), /* @__PURE__ */ JSX4.createElement("script", null, /* @__PURE__ */ JSX4.createElement(JSX4.Raw, {
|
|
377
382
|
html: 'document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";'
|
|
378
|
-
})), /* @__PURE__ */
|
|
383
|
+
})), /* @__PURE__ */ JSX4.createElement("div", {
|
|
379
384
|
class: "container container-main"
|
|
380
|
-
}, context.toolbar(props), /* @__PURE__ */
|
|
385
|
+
}, context.toolbar(props), /* @__PURE__ */ JSX4.createElement("div", {
|
|
381
386
|
class: "col-content"
|
|
382
|
-
}, context.hook("content.begin", context), context.header(props), template(props), context.hook("content.end", context)), /* @__PURE__ */
|
|
387
|
+
}, context.hook("content.begin", context), context.header(props), template(props), context.hook("content.end", context)), /* @__PURE__ */ JSX4.createElement("div", {
|
|
383
388
|
class: "col-sidebar"
|
|
384
|
-
}, /* @__PURE__ */
|
|
389
|
+
}, /* @__PURE__ */ JSX4.createElement("div", {
|
|
385
390
|
class: "page-menu"
|
|
386
|
-
}, context.hook("pageSidebar.begin", context), context.pageSidebar(props), context.hook("pageSidebar.end", context)), /* @__PURE__ */
|
|
391
|
+
}, context.hook("pageSidebar.begin", context), context.pageSidebar(props), context.hook("pageSidebar.end", context)), /* @__PURE__ */ JSX4.createElement("div", {
|
|
387
392
|
class: "site-menu"
|
|
388
|
-
}, context.hook("sidebar.begin", context), context.sidebar(props), context.hook("sidebar.end", context)))), context.footer(), /* @__PURE__ */
|
|
393
|
+
}, context.hook("sidebar.begin", context), context.sidebar(props), context.hook("sidebar.end", context)))), context.footer(), /* @__PURE__ */ JSX4.createElement("div", {
|
|
389
394
|
class: "overlay"
|
|
390
395
|
}), context.hook("body.end", context)));
|
|
391
396
|
}
|
|
@@ -395,18 +400,18 @@ function favicon(context) {
|
|
|
395
400
|
return null;
|
|
396
401
|
switch (extname(fav)) {
|
|
397
402
|
case ".ico":
|
|
398
|
-
return /* @__PURE__ */
|
|
403
|
+
return /* @__PURE__ */ JSX4.createElement("link", {
|
|
399
404
|
rel: "icon",
|
|
400
405
|
href: context.relativeURL("assets/favicon.ico", true)
|
|
401
406
|
});
|
|
402
407
|
case ".png":
|
|
403
|
-
return /* @__PURE__ */
|
|
408
|
+
return /* @__PURE__ */ JSX4.createElement("link", {
|
|
404
409
|
rel: "icon",
|
|
405
410
|
href: context.relativeURL("assets/favicon.png", true),
|
|
406
411
|
type: "image/png"
|
|
407
412
|
});
|
|
408
413
|
case ".svg":
|
|
409
|
-
return /* @__PURE__ */
|
|
414
|
+
return /* @__PURE__ */ JSX4.createElement("link", {
|
|
410
415
|
rel: "icon",
|
|
411
416
|
href: context.relativeURL("assets/favicon.svg", true),
|
|
412
417
|
type: "image/svg+xml"
|
|
@@ -421,9 +426,9 @@ function buildSiteMetadata(context) {
|
|
|
421
426
|
if (url.pathname !== "/") {
|
|
422
427
|
return null;
|
|
423
428
|
}
|
|
424
|
-
return /* @__PURE__ */
|
|
429
|
+
return /* @__PURE__ */ JSX4.createElement("script", {
|
|
425
430
|
type: "application/ld+json"
|
|
426
|
-
}, /* @__PURE__ */
|
|
431
|
+
}, /* @__PURE__ */ JSX4.createElement(JSX4.Raw, {
|
|
427
432
|
html: JSON.stringify({
|
|
428
433
|
"@context": "https://schema.org",
|
|
429
434
|
"@type": "WebSite",
|
|
@@ -443,11 +448,11 @@ class VarvaraThemeContext extends DefaultThemeRenderContext3 {
|
|
|
443
448
|
this.pageSidebar = pageSidebar(this);
|
|
444
449
|
this.toolbar = toolbar(this);
|
|
445
450
|
this.defaultLayout = layout(this);
|
|
446
|
-
this.sidebar = sidebar(this);
|
|
447
451
|
this.settings = settings(this);
|
|
448
452
|
this.pageNavigation = pageNavigation(this);
|
|
449
453
|
}
|
|
450
454
|
footer = () => footer(this);
|
|
455
|
+
navigation = (context) => navigation(this)(context);
|
|
451
456
|
}
|
|
452
457
|
|
|
453
458
|
// src/themes/VarvaraTheme.tsx
|
|
@@ -461,10 +466,10 @@ class VarvaraTheme extends DefaultTheme2 {
|
|
|
461
466
|
fs.copyFileSync(varvaraCssPath, destPath);
|
|
462
467
|
fs.cpSync(path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../assets/"), path.resolve(this.application.options.getValue("out"), "assets/"), { recursive: true });
|
|
463
468
|
});
|
|
464
|
-
renderer.hooks.on("head.end", (event) => /* @__PURE__ */
|
|
469
|
+
renderer.hooks.on("head.end", (event) => /* @__PURE__ */ JSX5.createElement(JSX5.Fragment, null, /* @__PURE__ */ JSX5.createElement("link", {
|
|
465
470
|
rel: "stylesheet",
|
|
466
471
|
href: event.relativeURL("assets/varvara.css")
|
|
467
|
-
}), /* @__PURE__ */
|
|
472
|
+
}), /* @__PURE__ */ JSX5.createElement("link", {
|
|
468
473
|
rel: "stylesheet",
|
|
469
474
|
href: event.relativeURL("assets/overrides.css")
|
|
470
475
|
})));
|