clean-jsdoc-theme 5.1.1 → 5.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/README.md +3 -3
- package/dist/publish.d.mts +272 -260
- package/dist/publish.d.ts +272 -260
- package/dist/publish.js +1514 -1269
- package/dist/publish.js.map +1 -1
- package/dist/publish.mjs +1495 -1222
- package/dist/publish.mjs.map +1 -1
- package/package.json +9 -9
package/dist/publish.d.ts
CHANGED
|
@@ -1,234 +1,245 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DocInput, MenuItem, PlaygroundSiteConfig, TutorialInput } from
|
|
3
|
-
|
|
1
|
+
import { CopyPageConfig, MetaTag, OutputFile, PageNavConfig, SiteLogo, ThemeColors, ThemeConfig } from "@clean-jsdoc-theme/dwar";
|
|
2
|
+
import { DocInput, MenuItem, PlaygroundSiteConfig, TutorialInput } from "@clean-jsdoc-theme/setu";
|
|
3
|
+
//#region src/publish.d.ts
|
|
4
4
|
interface JSDocOpts {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
destination?: string;
|
|
6
|
+
package?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Site identity from `jsdoc.json` (`"opts": { "siteName": ... }`). Either a
|
|
9
|
+
* string (shown in the header/footer and appended to each page's `<title>`),
|
|
10
|
+
* or a logo image set `{ default, dark, light, alt }`. Local image paths are
|
|
11
|
+
* copied into the output; `http(s)://` and `data:` values pass through. The
|
|
12
|
+
* `alt` text (or `pkg.name`) is used for the `<title>` suffix and image alt.
|
|
13
|
+
*/
|
|
14
|
+
siteName?: string | SiteLogo;
|
|
15
|
+
/**
|
|
16
|
+
* Font overrides from `jsdoc.json` (`"opts": { "fonts": { ... } }`). Values
|
|
17
|
+
* are Google Fonts family names for `heading`/`body`; `mono` is a CSS stack.
|
|
18
|
+
*/
|
|
19
|
+
fonts?: {
|
|
20
|
+
heading?: string;
|
|
21
|
+
body?: string;
|
|
22
|
+
mono?: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Light-mode color overrides from `jsdoc.json` (`"opts": { "colors": { ... } }`).
|
|
26
|
+
* Any subset of `bg`, `bgMuted`, `fg`, `fgMuted`, `accent`, `accentFg`, `border`;
|
|
27
|
+
* each value is any CSS color string (the theme ships oklch). Omitted keys keep
|
|
28
|
+
* the default palette.
|
|
29
|
+
*/
|
|
30
|
+
colors?: unknown;
|
|
31
|
+
/**
|
|
32
|
+
* Dark-mode color overrides (`"opts": { "darkColors": { ... } }`). Same keys as
|
|
33
|
+
* {@link JSDocOpts.colors}; emitted under `[data-theme="dark"]`. Omitted keys
|
|
34
|
+
* keep the default dark palette.
|
|
35
|
+
*/
|
|
36
|
+
darkColors?: unknown;
|
|
37
|
+
/**
|
|
38
|
+
* Project README as HTML. JSDoc renders the Markdown README (`-R`/`opts.readme`
|
|
39
|
+
* or one found in the source paths) and replaces this with the resulting HTML
|
|
40
|
+
* before calling `publish`. Rendered as the site home page.
|
|
41
|
+
*/
|
|
42
|
+
readme?: string;
|
|
43
|
+
/** Path to the tutorials directory (`-u`/`opts.tutorials`); resolved tree arrives as the 3rd `publish` arg. */
|
|
44
|
+
tutorials?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Path to a docs content directory (`jsdoc.json` `"opts": { "docs": "docs/" }`),
|
|
47
|
+
* resolved relative to the cwd. The bridge walks it recursively; each
|
|
48
|
+
* `*.md`/`*.markdown` (and `*.html`) file becomes a prose page at its clean,
|
|
49
|
+
* unprefixed slug (the relative path), grouped by frontmatter/directory. A root
|
|
50
|
+
* `index.md` becomes the home page. Unset → no docs site (today's behavior).
|
|
51
|
+
*/
|
|
52
|
+
docs?: unknown;
|
|
53
|
+
/**
|
|
54
|
+
* Top-level doc-group display order (`jsdoc.json` `"opts": { "docGroups": [...] }`).
|
|
55
|
+
* An ordered list of doc-group labels controlling how the doc-group sidebar
|
|
56
|
+
* sections render (after the API sections). Omit for the default order.
|
|
57
|
+
*/
|
|
58
|
+
docGroups?: unknown;
|
|
59
|
+
/**
|
|
60
|
+
* Group label assigned to a doc page that carries no frontmatter/directory
|
|
61
|
+
* group (`jsdoc.json` `"opts": { "defaultDocGroup": "Docs" }`). Omit to leave
|
|
62
|
+
* such pages ungrouped.
|
|
63
|
+
*/
|
|
64
|
+
defaultDocGroup?: unknown;
|
|
65
|
+
/**
|
|
66
|
+
* Sidebar section order from `jsdoc.json` (`"opts": { "sectionOrder": [...] }`).
|
|
67
|
+
* An ordered list of section labels (e.g. `["Classes", "Tutorials"]`) that both
|
|
68
|
+
* filters and orders the sidebar sections; "Home" and "Source Files" are always
|
|
69
|
+
* shown regardless. Omit (or leave empty) for the default order.
|
|
70
|
+
*/
|
|
71
|
+
sectionOrder?: unknown;
|
|
72
|
+
/**
|
|
73
|
+
* Full sidebar menu from `jsdoc.json` (`"opts": { "menu": [...] }`). An ordered
|
|
74
|
+
* list of `{ id, title, href, icon }` entries. When present it takes precedence
|
|
75
|
+
* over `sectionOrder` and controls the entire sidebar (built-ins, sections, and
|
|
76
|
+
* external links). See setu's {@link MenuItem}.
|
|
77
|
+
*/
|
|
78
|
+
menu?: unknown;
|
|
79
|
+
/**
|
|
80
|
+
* Club related sidebar entries into prefix-grouped subtrees (`jsdoc.json`
|
|
81
|
+
* `"opts": { "clubSidebarItems": true }`). Groups entries within each section
|
|
82
|
+
* by the path segment before the first `/` (e.g. `queue/*` under a `queue`
|
|
83
|
+
* parent); a prefix with a single entry is left flat. Off by default.
|
|
84
|
+
*/
|
|
85
|
+
clubSidebarItems?: unknown;
|
|
86
|
+
/**
|
|
87
|
+
* Which top-level sidebar sections collapse (`jsdoc.json`
|
|
88
|
+
* `"opts": { "collapsibleSidebarSections": true | ["Classes","Namespaces"] }`).
|
|
89
|
+
* `true`/absent → all; `false` → none; array → only those exact labels
|
|
90
|
+
* (case-sensitive). Unmatched labels warn. See utils `resolveCollapsibleSections`.
|
|
91
|
+
*/
|
|
92
|
+
collapsibleSidebarSections?: unknown;
|
|
93
|
+
/**
|
|
94
|
+
* Custom prompt for the copy-page button's "Open in ChatGPT/Claude/Perplexity"
|
|
95
|
+
* actions (`jsdoc.json` `"opts": { "aiPrompt": "…" }`). `{siteName}`, `{url}`,
|
|
96
|
+
* and `{mdUrl}` (the page's raw Markdown link) placeholders are substituted at
|
|
97
|
+
* click time. Only the prompt + links are sent (the AI fetches `{mdUrl}`), so
|
|
98
|
+
* the query stays short for long docs. Omit for a sensible default.
|
|
99
|
+
*/
|
|
100
|
+
aiPrompt?: unknown;
|
|
101
|
+
/**
|
|
102
|
+
* Copy-page button config (`jsdoc.json` `"opts": { "copyPage": … }`). Either a
|
|
103
|
+
* boolean (`false` hides the button) or an object `{ enabled?, actions? }`,
|
|
104
|
+
* where `actions` is an ordered subset of
|
|
105
|
+
* `["copy","view","claude","chatgpt","perplexity"]` (`[]` shows just the
|
|
106
|
+
* primary copy button). Defaults to enabled with all actions.
|
|
107
|
+
*/
|
|
108
|
+
copyPage?: unknown;
|
|
109
|
+
/**
|
|
110
|
+
* Previous/next page pager config (`jsdoc.json` `"opts": { "pageNav": … }`).
|
|
111
|
+
* Either a boolean (`false` hides the pager) or an object `{ enabled? }`. The
|
|
112
|
+
* pager links each content page to its neighbors in sidebar reading order.
|
|
113
|
+
* Defaults to enabled.
|
|
114
|
+
*/
|
|
115
|
+
pageNav?: unknown;
|
|
116
|
+
/**
|
|
117
|
+
* Scrollbar presentation (`jsdoc.json` `"opts": { "scrollbar": "native" }`).
|
|
118
|
+
* `"styled"` (default) = overlay bar that hides at rest; `"visible"` = themed
|
|
119
|
+
* bar always shown; `"native"` = the browser's own scrollbar. See #281.
|
|
120
|
+
*/
|
|
121
|
+
scrollbar?: unknown;
|
|
122
|
+
/**
|
|
123
|
+
* Code-playground config (`jsdoc.json` `"opts": { "playground": … }`). Either
|
|
124
|
+
* a boolean (`true` turns it on with defaults; absent/`false` = off) or an
|
|
125
|
+
* object `{ enableForAllExamples?, providers?, codepen?, jsfiddle?,
|
|
126
|
+
* codesandbox? }`. `providers` picks which of CodePen/JSFiddle/CodeSandbox an
|
|
127
|
+
* `@example` (or prose code block) can be opened in; the per-provider records
|
|
128
|
+
* hold their site-wide runtime options. When set, `@playground` tags are
|
|
129
|
+
* honored; when off, they're ignored (byte-identical output).
|
|
130
|
+
*/
|
|
131
|
+
playground?: unknown;
|
|
132
|
+
/**
|
|
133
|
+
* Custom site footer (`jsdoc.json` `"opts": { "footer": … }`). Either an
|
|
134
|
+
* inline HTML string (v4 parity) or `{ "file": "./footer.html" }` (read from
|
|
135
|
+
* disk by the bridge). Rendered into rang's footer slot in place of the
|
|
136
|
+
* default footer on every page; style it with `customCss`/`customCssFile`.
|
|
137
|
+
* Omit for the default footer.
|
|
138
|
+
*/
|
|
139
|
+
footer?: unknown;
|
|
140
|
+
/**
|
|
141
|
+
* Site public base URL (`jsdoc.json` `"opts": { "siteUrl": "https://example.com" }`).
|
|
142
|
+
* When set, the build emits a `sitemap.xml` at the output root listing every
|
|
143
|
+
* non-hidden page's canonical URL. Only the URL's origin is used — the deploy
|
|
144
|
+
* sub-path comes from `basePath` — so a bare origin or a full URL whose path
|
|
145
|
+
* equals `basePath` both work. Omit it for no sitemap.
|
|
146
|
+
*/
|
|
147
|
+
siteUrl?: unknown;
|
|
148
|
+
/**
|
|
149
|
+
* Emit an llmstxt.org index (`jsdoc.json` `"opts": { "llmsTxt": true }`) —
|
|
150
|
+
* `llms.txt` at the output root, plus `llms-full.txt` (every page concatenated)
|
|
151
|
+
* unless `full: false`. Accepts `true` (⇒ `{ full: true, api: true }`) or
|
|
152
|
+
* `{ full?: boolean, api?: boolean | 'index' }`, where `api: 'index'` lists API
|
|
153
|
+
* pages without descriptions and omits their bodies from `llms-full.txt`, and
|
|
154
|
+
* `api: false` omits API pages entirely. **Requires `siteUrl`** — the file is
|
|
155
|
+
* fetched standalone, so its links must be absolute; without it the build warns
|
|
156
|
+
* and emits nothing.
|
|
157
|
+
*/
|
|
158
|
+
llmsTxt?: unknown;
|
|
159
|
+
/**
|
|
160
|
+
* Favicon (`jsdoc.json` `"opts": { "favicon": "./icon.svg" }`). A path to an
|
|
161
|
+
* image file (`.svg`/`.png`/`.ico`/…), relative to the working dir. The bridge
|
|
162
|
+
* copies it to a content-hashed `_assets/` asset and emits a `<link rel="icon">`
|
|
163
|
+
* in every page's `<head>`. Needed for an SVG favicon (browsers only
|
|
164
|
+
* auto-discover a root `favicon.ico`). Omit for none.
|
|
165
|
+
*/
|
|
166
|
+
favicon?: unknown;
|
|
167
|
+
/**
|
|
168
|
+
* Site-wide custom `<meta>` tags (`jsdoc.json` `"opts": { "meta": [...] }`). An
|
|
169
|
+
* array of attribute maps — each object's key/value pairs become one `<meta>`
|
|
170
|
+
* tag in `<head>` (`{ name, content }`, `{ property, content }`, …). dwar
|
|
171
|
+
* escapes values, drops invalid attribute names, and de-dupes against its own
|
|
172
|
+
* head defaults (an author `name: "description"` replaces the auto one).
|
|
173
|
+
*/
|
|
174
|
+
meta?: unknown;
|
|
175
|
+
/**
|
|
176
|
+
* Inline custom CSS (`jsdoc.json` `"opts": { "customCss": "…" }`), injected as
|
|
177
|
+
* a `<style>` after the theme stylesheet so it can override.
|
|
178
|
+
*/
|
|
179
|
+
customCss?: unknown;
|
|
180
|
+
/**
|
|
181
|
+
* Path(s) to custom CSS file(s) (`"opts": { "customCssFile": "a.css" }` or an
|
|
182
|
+
* array). Each file is copied AS-IS (its own bytes) to
|
|
183
|
+
* `_assets/<name>.<hash>.css` and linked after the theme stylesheet. The
|
|
184
|
+
* `<hash>` is a content hash (see `hashCustomAssets`), so an unchanged file
|
|
185
|
+
* keeps a stable, cacheable URL.
|
|
186
|
+
*/
|
|
187
|
+
customCssFile?: unknown;
|
|
188
|
+
/**
|
|
189
|
+
* Inline custom JS (`"opts": { "customJs": "…" }`), injected as a classic
|
|
190
|
+
* `<script>` before `</body>`, after the theme's own scripts.
|
|
191
|
+
*/
|
|
192
|
+
customJs?: unknown;
|
|
193
|
+
/**
|
|
194
|
+
* Path(s) to custom JS file(s) (`"opts": { "customJsFile": "a.js" }` or an
|
|
195
|
+
* array). Each file is copied AS-IS to `_assets/<name>.<hash>.js` and
|
|
196
|
+
* referenced before `</body>`. See `hashCustomAssets`.
|
|
197
|
+
*/
|
|
198
|
+
customJsFile?: unknown;
|
|
199
|
+
/**
|
|
200
|
+
* Whether to append a content hash to copied `customCssFile`/`customJsFile`
|
|
201
|
+
* asset names (`_assets/<name>.<hash>.css`). Defaults to `true` — the hash is
|
|
202
|
+
* derived from the file's content (NOT random), so an unchanged file yields
|
|
203
|
+
* the same URL across builds (cache-friendly) and a changed file cache-busts.
|
|
204
|
+
* Set `false` to copy with the original `<name>.css`/`.js` (no hash).
|
|
205
|
+
*/
|
|
206
|
+
hashCustomAssets?: unknown;
|
|
207
|
+
/**
|
|
208
|
+
* Build-stage progress output (`jsdoc.json` `"opts": { "progress": false }`).
|
|
209
|
+
* The setu→dwar pipeline does noticeably more than a bare jsdoc run (per-page
|
|
210
|
+
* MDX compile, per-island esbuild bundling, the island cache), so by default
|
|
211
|
+
* the bridge narrates each stage with its elapsed time. Set `false` to silence
|
|
212
|
+
* the stage lines (the build report still prints).
|
|
213
|
+
*/
|
|
214
|
+
progress?: unknown;
|
|
215
|
+
/**
|
|
216
|
+
* JSDoc's default-template source options, read from `conf.templates.default`
|
|
217
|
+
* (or, as a fallback, nested under `opts.templates`):
|
|
218
|
+
* - `outputSourceFiles` — defaults to `true`; set `false` to suppress the
|
|
219
|
+
* per-file source viewer pages and the `Source: file:line` member links.
|
|
220
|
+
* - `sourceLinkToComment` — defaults to `false`. By default a `Source:`
|
|
221
|
+
* link lands on the first line of the declaration; set `true` to point it
|
|
222
|
+
* at the doclet's doc-comment line instead (the pre-v5 behavior).
|
|
223
|
+
* - `cleanOutputDir` — defaults to `true`; set `false` to keep existing files
|
|
224
|
+
* in the destination instead of emptying it before each build.
|
|
225
|
+
*/
|
|
226
|
+
templates?: {
|
|
227
|
+
default?: {
|
|
228
|
+
outputSourceFiles?: unknown;
|
|
229
|
+
sourceLinkToComment?: unknown;
|
|
230
|
+
cleanOutputDir?: unknown;
|
|
231
|
+
/**
|
|
232
|
+
* JSDoc's standard static-file passthrough
|
|
233
|
+
* (`templates.default.staticFiles`): `{ include, exclude, includePattern,
|
|
234
|
+
* excludePattern }`. Files matched by `include` are copied verbatim into
|
|
235
|
+
* the output (an include dir's contents land at the output root, JSDoc's
|
|
236
|
+
* mapping) AND their dirs become fallback search roots for image
|
|
237
|
+
* resolution, so a bare/relative reference to a static image resolves.
|
|
238
|
+
*/
|
|
239
|
+
staticFiles?: unknown;
|
|
23
240
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
* Any subset of `bg`, `bgMuted`, `fg`, `fgMuted`, `accent`, `accentFg`, `border`;
|
|
27
|
-
* each value is any CSS color string (the theme ships oklch). Omitted keys keep
|
|
28
|
-
* the default palette.
|
|
29
|
-
*/
|
|
30
|
-
colors?: unknown;
|
|
31
|
-
/**
|
|
32
|
-
* Dark-mode color overrides (`"opts": { "darkColors": { ... } }`). Same keys as
|
|
33
|
-
* {@link JSDocOpts.colors}; emitted under `[data-theme="dark"]`. Omitted keys
|
|
34
|
-
* keep the default dark palette.
|
|
35
|
-
*/
|
|
36
|
-
darkColors?: unknown;
|
|
37
|
-
/**
|
|
38
|
-
* Project README as HTML. JSDoc renders the Markdown README (`-R`/`opts.readme`
|
|
39
|
-
* or one found in the source paths) and replaces this with the resulting HTML
|
|
40
|
-
* before calling `publish`. Rendered as the site home page.
|
|
41
|
-
*/
|
|
42
|
-
readme?: string;
|
|
43
|
-
/** Path to the tutorials directory (`-u`/`opts.tutorials`); resolved tree arrives as the 3rd `publish` arg. */
|
|
44
|
-
tutorials?: string;
|
|
45
|
-
/**
|
|
46
|
-
* Path to a docs content directory (`jsdoc.json` `"opts": { "docs": "docs/" }`),
|
|
47
|
-
* resolved relative to the cwd. The bridge walks it recursively; each
|
|
48
|
-
* `*.md`/`*.markdown` (and `*.html`) file becomes a prose page at its clean,
|
|
49
|
-
* unprefixed slug (the relative path), grouped by frontmatter/directory. A root
|
|
50
|
-
* `index.md` becomes the home page. Unset → no docs site (today's behavior).
|
|
51
|
-
*/
|
|
52
|
-
docs?: unknown;
|
|
53
|
-
/**
|
|
54
|
-
* Top-level doc-group display order (`jsdoc.json` `"opts": { "docGroups": [...] }`).
|
|
55
|
-
* An ordered list of doc-group labels controlling how the doc-group sidebar
|
|
56
|
-
* sections render (after the API sections). Omit for the default order.
|
|
57
|
-
*/
|
|
58
|
-
docGroups?: unknown;
|
|
59
|
-
/**
|
|
60
|
-
* Group label assigned to a doc page that carries no frontmatter/directory
|
|
61
|
-
* group (`jsdoc.json` `"opts": { "defaultDocGroup": "Docs" }`). Omit to leave
|
|
62
|
-
* such pages ungrouped.
|
|
63
|
-
*/
|
|
64
|
-
defaultDocGroup?: unknown;
|
|
65
|
-
/**
|
|
66
|
-
* Sidebar section order from `jsdoc.json` (`"opts": { "sectionOrder": [...] }`).
|
|
67
|
-
* An ordered list of section labels (e.g. `["Classes", "Tutorials"]`) that both
|
|
68
|
-
* filters and orders the sidebar sections; "Home" and "Source Files" are always
|
|
69
|
-
* shown regardless. Omit (or leave empty) for the default order.
|
|
70
|
-
*/
|
|
71
|
-
sectionOrder?: unknown;
|
|
72
|
-
/**
|
|
73
|
-
* Full sidebar menu from `jsdoc.json` (`"opts": { "menu": [...] }`). An ordered
|
|
74
|
-
* list of `{ id, title, href, icon }` entries. When present it takes precedence
|
|
75
|
-
* over `sectionOrder` and controls the entire sidebar (built-ins, sections, and
|
|
76
|
-
* external links). See setu's {@link MenuItem}.
|
|
77
|
-
*/
|
|
78
|
-
menu?: unknown;
|
|
79
|
-
/**
|
|
80
|
-
* Club related sidebar entries into prefix-grouped subtrees (`jsdoc.json`
|
|
81
|
-
* `"opts": { "clubSidebarItems": true }`). Groups entries within each section
|
|
82
|
-
* by the path segment before the first `/` (e.g. `queue/*` under a `queue`
|
|
83
|
-
* parent); a prefix with a single entry is left flat. Off by default.
|
|
84
|
-
*/
|
|
85
|
-
clubSidebarItems?: unknown;
|
|
86
|
-
/**
|
|
87
|
-
* Which top-level sidebar sections collapse (`jsdoc.json`
|
|
88
|
-
* `"opts": { "collapsibleSidebarSections": true | ["Classes","Namespaces"] }`).
|
|
89
|
-
* `true`/absent → all; `false` → none; array → only those exact labels
|
|
90
|
-
* (case-sensitive). Unmatched labels warn. See utils `resolveCollapsibleSections`.
|
|
91
|
-
*/
|
|
92
|
-
collapsibleSidebarSections?: unknown;
|
|
93
|
-
/**
|
|
94
|
-
* Custom prompt for the copy-page button's "Open in ChatGPT/Claude/Perplexity"
|
|
95
|
-
* actions (`jsdoc.json` `"opts": { "aiPrompt": "…" }`). `{siteName}`, `{url}`,
|
|
96
|
-
* and `{mdUrl}` (the page's raw Markdown link) placeholders are substituted at
|
|
97
|
-
* click time. Only the prompt + links are sent (the AI fetches `{mdUrl}`), so
|
|
98
|
-
* the query stays short for long docs. Omit for a sensible default.
|
|
99
|
-
*/
|
|
100
|
-
aiPrompt?: unknown;
|
|
101
|
-
/**
|
|
102
|
-
* Copy-page button config (`jsdoc.json` `"opts": { "copyPage": … }`). Either a
|
|
103
|
-
* boolean (`false` hides the button) or an object `{ enabled?, actions? }`,
|
|
104
|
-
* where `actions` is an ordered subset of
|
|
105
|
-
* `["copy","view","claude","chatgpt","perplexity"]` (`[]` shows just the
|
|
106
|
-
* primary copy button). Defaults to enabled with all actions.
|
|
107
|
-
*/
|
|
108
|
-
copyPage?: unknown;
|
|
109
|
-
/**
|
|
110
|
-
* Previous/next page pager config (`jsdoc.json` `"opts": { "pageNav": … }`).
|
|
111
|
-
* Either a boolean (`false` hides the pager) or an object `{ enabled? }`. The
|
|
112
|
-
* pager links each content page to its neighbors in sidebar reading order.
|
|
113
|
-
* Defaults to enabled.
|
|
114
|
-
*/
|
|
115
|
-
pageNav?: unknown;
|
|
116
|
-
/**
|
|
117
|
-
* Scrollbar presentation (`jsdoc.json` `"opts": { "scrollbar": "native" }`).
|
|
118
|
-
* `"styled"` (default) = overlay bar that hides at rest; `"visible"` = themed
|
|
119
|
-
* bar always shown; `"native"` = the browser's own scrollbar. See #281.
|
|
120
|
-
*/
|
|
121
|
-
scrollbar?: unknown;
|
|
122
|
-
/**
|
|
123
|
-
* Code-playground config (`jsdoc.json` `"opts": { "playground": … }`). Either
|
|
124
|
-
* a boolean (`true` turns it on with defaults; absent/`false` = off) or an
|
|
125
|
-
* object `{ enableForAllExamples?, providers?, codepen?, jsfiddle?,
|
|
126
|
-
* codesandbox? }`. `providers` picks which of CodePen/JSFiddle/CodeSandbox an
|
|
127
|
-
* `@example` (or prose code block) can be opened in; the per-provider records
|
|
128
|
-
* hold their site-wide runtime options. When set, `@playground` tags are
|
|
129
|
-
* honored; when off, they're ignored (byte-identical output).
|
|
130
|
-
*/
|
|
131
|
-
playground?: unknown;
|
|
132
|
-
/**
|
|
133
|
-
* Custom site footer (`jsdoc.json` `"opts": { "footer": … }`). Either an
|
|
134
|
-
* inline HTML string (v4 parity) or `{ "file": "./footer.html" }` (read from
|
|
135
|
-
* disk by the bridge). Rendered into rang's footer slot in place of the
|
|
136
|
-
* default footer on every page; style it with `customCss`/`customCssFile`.
|
|
137
|
-
* Omit for the default footer.
|
|
138
|
-
*/
|
|
139
|
-
footer?: unknown;
|
|
140
|
-
/**
|
|
141
|
-
* Site public base URL (`jsdoc.json` `"opts": { "siteUrl": "https://example.com" }`).
|
|
142
|
-
* When set, the build emits a `sitemap.xml` at the output root listing every
|
|
143
|
-
* non-hidden page's canonical URL. Only the URL's origin is used — the deploy
|
|
144
|
-
* sub-path comes from `basePath` — so a bare origin or a full URL whose path
|
|
145
|
-
* equals `basePath` both work. Omit it for no sitemap.
|
|
146
|
-
*/
|
|
147
|
-
siteUrl?: unknown;
|
|
148
|
-
/**
|
|
149
|
-
* Favicon (`jsdoc.json` `"opts": { "favicon": "./icon.svg" }`). A path to an
|
|
150
|
-
* image file (`.svg`/`.png`/`.ico`/…), relative to the working dir. The bridge
|
|
151
|
-
* copies it to a content-hashed `_assets/` asset and emits a `<link rel="icon">`
|
|
152
|
-
* in every page's `<head>`. Needed for an SVG favicon (browsers only
|
|
153
|
-
* auto-discover a root `favicon.ico`). Omit for none.
|
|
154
|
-
*/
|
|
155
|
-
favicon?: unknown;
|
|
156
|
-
/**
|
|
157
|
-
* Site-wide custom `<meta>` tags (`jsdoc.json` `"opts": { "meta": [...] }`). An
|
|
158
|
-
* array of attribute maps — each object's key/value pairs become one `<meta>`
|
|
159
|
-
* tag in `<head>` (`{ name, content }`, `{ property, content }`, …). dwar
|
|
160
|
-
* escapes values, drops invalid attribute names, and de-dupes against its own
|
|
161
|
-
* head defaults (an author `name: "description"` replaces the auto one).
|
|
162
|
-
*/
|
|
163
|
-
meta?: unknown;
|
|
164
|
-
/**
|
|
165
|
-
* Inline custom CSS (`jsdoc.json` `"opts": { "customCss": "…" }`), injected as
|
|
166
|
-
* a `<style>` after the theme stylesheet so it can override.
|
|
167
|
-
*/
|
|
168
|
-
customCss?: unknown;
|
|
169
|
-
/**
|
|
170
|
-
* Path(s) to custom CSS file(s) (`"opts": { "customCssFile": "a.css" }` or an
|
|
171
|
-
* array). Each file is copied AS-IS (its own bytes) to
|
|
172
|
-
* `_assets/<name>.<hash>.css` and linked after the theme stylesheet. The
|
|
173
|
-
* `<hash>` is a content hash (see `hashCustomAssets`), so an unchanged file
|
|
174
|
-
* keeps a stable, cacheable URL.
|
|
175
|
-
*/
|
|
176
|
-
customCssFile?: unknown;
|
|
177
|
-
/**
|
|
178
|
-
* Inline custom JS (`"opts": { "customJs": "…" }`), injected as a classic
|
|
179
|
-
* `<script>` before `</body>`, after the theme's own scripts.
|
|
180
|
-
*/
|
|
181
|
-
customJs?: unknown;
|
|
182
|
-
/**
|
|
183
|
-
* Path(s) to custom JS file(s) (`"opts": { "customJsFile": "a.js" }` or an
|
|
184
|
-
* array). Each file is copied AS-IS to `_assets/<name>.<hash>.js` and
|
|
185
|
-
* referenced before `</body>`. See `hashCustomAssets`.
|
|
186
|
-
*/
|
|
187
|
-
customJsFile?: unknown;
|
|
188
|
-
/**
|
|
189
|
-
* Whether to append a content hash to copied `customCssFile`/`customJsFile`
|
|
190
|
-
* asset names (`_assets/<name>.<hash>.css`). Defaults to `true` — the hash is
|
|
191
|
-
* derived from the file's content (NOT random), so an unchanged file yields
|
|
192
|
-
* the same URL across builds (cache-friendly) and a changed file cache-busts.
|
|
193
|
-
* Set `false` to copy with the original `<name>.css`/`.js` (no hash).
|
|
194
|
-
*/
|
|
195
|
-
hashCustomAssets?: unknown;
|
|
196
|
-
/**
|
|
197
|
-
* Build-stage progress output (`jsdoc.json` `"opts": { "progress": false }`).
|
|
198
|
-
* The setu→dwar pipeline does noticeably more than a bare jsdoc run (per-page
|
|
199
|
-
* MDX compile, per-island esbuild bundling, the Pagefind index), so by default
|
|
200
|
-
* the bridge narrates each stage with its elapsed time. Set `false` to silence
|
|
201
|
-
* the stage lines (the build report still prints).
|
|
202
|
-
*/
|
|
203
|
-
progress?: unknown;
|
|
204
|
-
/**
|
|
205
|
-
* JSDoc's default-template source options, read from `conf.templates.default`
|
|
206
|
-
* (or, as a fallback, nested under `opts.templates`):
|
|
207
|
-
* - `outputSourceFiles` — defaults to `true`; set `false` to suppress the
|
|
208
|
-
* per-file source viewer pages and the `Source: file:line` member links.
|
|
209
|
-
* - `sourceLinkToComment` — defaults to `false`. By default a `Source:`
|
|
210
|
-
* link lands on the first line of the declaration; set `true` to point it
|
|
211
|
-
* at the doclet's doc-comment line instead (the pre-v5 behavior).
|
|
212
|
-
* - `cleanOutputDir` — defaults to `true`; set `false` to keep existing files
|
|
213
|
-
* in the destination instead of emptying it before each build.
|
|
214
|
-
*/
|
|
215
|
-
templates?: {
|
|
216
|
-
default?: {
|
|
217
|
-
outputSourceFiles?: unknown;
|
|
218
|
-
sourceLinkToComment?: unknown;
|
|
219
|
-
cleanOutputDir?: unknown;
|
|
220
|
-
/**
|
|
221
|
-
* JSDoc's standard static-file passthrough
|
|
222
|
-
* (`templates.default.staticFiles`): `{ include, exclude, includePattern,
|
|
223
|
-
* excludePattern }`. Files matched by `include` are copied verbatim into
|
|
224
|
-
* the output (an include dir's contents land at the output root, JSDoc's
|
|
225
|
-
* mapping) AND their dirs become fallback search roots for image
|
|
226
|
-
* resolution, so a bare/relative reference to a static image resolves.
|
|
227
|
-
*/
|
|
228
|
-
staticFiles?: unknown;
|
|
229
|
-
};
|
|
230
|
-
};
|
|
231
|
-
[key: string]: unknown;
|
|
241
|
+
};
|
|
242
|
+
[key: string]: unknown;
|
|
232
243
|
}
|
|
233
244
|
/**
|
|
234
245
|
* Resolve `opts.footer` (inline HTML `string` | `{ file }`) into the single
|
|
@@ -248,8 +259,8 @@ declare function resolveFooter(raw: unknown): Promise<string | undefined>;
|
|
|
248
259
|
* (resilient, like the logo/custom-asset paths). Exported for testing.
|
|
249
260
|
*/
|
|
250
261
|
declare function resolveFavicon(raw: unknown, hash: boolean, hrefForServed: (servedPath: string) => string): Promise<{
|
|
251
|
-
|
|
252
|
-
|
|
262
|
+
href: string;
|
|
263
|
+
files: OutputFile[];
|
|
253
264
|
} | undefined>;
|
|
254
265
|
/**
|
|
255
266
|
* Validate `opts.meta` into a clean `MetaTag[]` (attribute maps), or `undefined`
|
|
@@ -338,8 +349,8 @@ declare function normalizePageNav(raw: unknown): PageNavConfig | undefined;
|
|
|
338
349
|
* byte-identical.
|
|
339
350
|
*/
|
|
340
351
|
declare function normalizePlayground(raw: unknown): {
|
|
341
|
-
|
|
342
|
-
|
|
352
|
+
site: PlaygroundSiteConfig;
|
|
353
|
+
theme: NonNullable<ThemeConfig['playground']>;
|
|
343
354
|
} | undefined;
|
|
344
355
|
/**
|
|
345
356
|
* Validate a user `colors`/`darkColors` object from `jsdoc.json` into a clean
|
|
@@ -399,10 +410,10 @@ declare function collectDocs(dir: string): Promise<DocInput[]>;
|
|
|
399
410
|
* them untouched.
|
|
400
411
|
*/
|
|
401
412
|
interface ImageCollector {
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
413
|
+
resolve(rawSrc: string, baseDir: string): Promise<string | null>;
|
|
414
|
+
readonly files: OutputFile[];
|
|
415
|
+
readonly inlineSvgs: Record<string, string>;
|
|
416
|
+
readonly consumed: Set<string>;
|
|
406
417
|
}
|
|
407
418
|
declare function createImageCollector(staticDirs?: readonly string[]): ImageCollector;
|
|
408
419
|
/**
|
|
@@ -417,9 +428,9 @@ declare function createImageCollector(staticDirs?: readonly string[]): ImageColl
|
|
|
417
428
|
* paths.
|
|
418
429
|
*/
|
|
419
430
|
declare function resolveDocImages(docs: DocInput[], docsDir: string, collector?: ImageCollector): Promise<{
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
431
|
+
docs: DocInput[];
|
|
432
|
+
files: OutputFile[];
|
|
433
|
+
inlineSvgs: Record<string, string>;
|
|
423
434
|
}>;
|
|
424
435
|
/**
|
|
425
436
|
* Resolve the local images referenced by tutorial content, routing them through
|
|
@@ -446,14 +457,14 @@ declare function resolveTutorialImages(tree: TutorialInput[], tutorialsDir: stri
|
|
|
446
457
|
declare function resolveDocletImages(data: unknown, collector: ImageCollector): Promise<void>;
|
|
447
458
|
/** Normalized `templates.default.staticFiles` config. */
|
|
448
459
|
interface StaticFilesConfig {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
460
|
+
/** Resolved-as-given include paths (dirs or files), trimmed, non-empty. */
|
|
461
|
+
include: string[];
|
|
462
|
+
/** Paths to exclude (a file equal to, or under, an excluded dir is dropped). */
|
|
463
|
+
exclude: string[];
|
|
464
|
+
/** Regex (source string) a file's POSIX abs path must match to be included. */
|
|
465
|
+
includePattern?: string;
|
|
466
|
+
/** Regex (source string) that drops a file when its POSIX abs path matches. */
|
|
467
|
+
excludePattern?: string;
|
|
457
468
|
}
|
|
458
469
|
/**
|
|
459
470
|
* Normalize a raw `staticFiles` block into a {@link StaticFilesConfig}, or
|
|
@@ -488,11 +499,11 @@ declare function staticFileOutputName(absFile: string, includeRootAbs: string):
|
|
|
488
499
|
declare function staticFileIncluded(absFile: string, config: StaticFilesConfig): boolean;
|
|
489
500
|
/** One verbatim static-file copy entry. */
|
|
490
501
|
interface StaticFileEntry {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
502
|
+
/** Output-relative POSIX path (where it lands under the destination). */
|
|
503
|
+
outputPath: string;
|
|
504
|
+
/** Absolute source path (matched against the image collector's `consumed`). */
|
|
505
|
+
absSource: string;
|
|
506
|
+
contents: Buffer;
|
|
496
507
|
}
|
|
497
508
|
/**
|
|
498
509
|
* Collect the files matched by a {@link StaticFilesConfig}: walk each include
|
|
@@ -505,14 +516,14 @@ interface StaticFileEntry {
|
|
|
505
516
|
* testing.
|
|
506
517
|
*/
|
|
507
518
|
declare function collectStaticFiles(config: StaticFilesConfig, warn?: (message: string) => void): Promise<{
|
|
508
|
-
|
|
509
|
-
|
|
519
|
+
files: StaticFileEntry[];
|
|
520
|
+
searchDirs: string[];
|
|
510
521
|
}>;
|
|
511
522
|
/** The output of {@link resolveDocImages}: resolved docs + their image assets. */
|
|
512
523
|
interface ResolvedDocs {
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
524
|
+
docs: DocInput[];
|
|
525
|
+
files: OutputFile[];
|
|
526
|
+
inlineSvgs: Record<string, string>;
|
|
516
527
|
}
|
|
517
528
|
/**
|
|
518
529
|
* Overlay a locale's resolved docs over the default set (the per-locale docs
|
|
@@ -531,5 +542,6 @@ declare function overlayDocs(base: ResolvedDocs, locale: ResolvedDocs): Resolved
|
|
|
531
542
|
*/
|
|
532
543
|
declare function normalizeDocGroups(raw: unknown): string[] | undefined;
|
|
533
544
|
declare function publish(data: unknown, opts: JSDocOpts, tutorials?: unknown): Promise<void>;
|
|
534
|
-
|
|
535
|
-
export {
|
|
545
|
+
//#endregion
|
|
546
|
+
export { ImageCollector, ResolvedDocs, StaticFileEntry, StaticFilesConfig, cleanOutputDirEnabled, collectDocs, collectStaticFiles, computeRelPaths, createImageCollector, hasMarkdownPlugin, normalizeColors, normalizeCopyPage, normalizeDocGroups, normalizeMenu, normalizeMeta, normalizePageNav, normalizePlayground, normalizeSectionOrder, normalizeStaticFilesConfig, outputSourceFilesEnabled, overlayDocs, publish, readStaticFilesConfig, resolveDocImages, resolveDocletImages, resolveFavicon, resolveFooter, resolveTutorialImages, sourceLinkToCommentEnabled, staticFileIncluded, staticFileOutputName };
|
|
547
|
+
//# sourceMappingURL=publish.d.ts.map
|