@pantoken/typedoc-plugin-live-example 0.1.0 → 0.1.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/dist/index.d.mts +2 -2
- package/dist/index.mjs +4 -4
- package/package.json +24 -13
package/dist/index.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import { Application } from "typedoc";
|
|
|
4
4
|
/** Options controlling how a live-example preview is built. */
|
|
5
5
|
interface LiveExampleOptions {
|
|
6
6
|
/**
|
|
7
|
-
* Build the block inserted after each `
|
|
7
|
+
* Build the block inserted after each `html` fence from the example's markup — override this to
|
|
8
8
|
* control the wrapper STRUCTURE (a card element, extra nesting, data attributes, …). It's called only
|
|
9
9
|
* for non-overlay examples. Defaults to {@link defaultWrap} (`<div class="css-example">…</div>`).
|
|
10
10
|
*
|
|
@@ -16,7 +16,7 @@ interface LiveExampleOptions {
|
|
|
16
16
|
/** The default wrapper: the example markup in a `<div class="css-example">`. */
|
|
17
17
|
declare function defaultWrap(html: string): string;
|
|
18
18
|
/**
|
|
19
|
-
* Append a live preview after each `
|
|
19
|
+
* Append a live preview after each `html` fence in `markdown`, echoing the fence's markup through
|
|
20
20
|
* {@link LiveExampleOptions.wrap} so it renders beneath the source. Overlay examples are left source-only.
|
|
21
21
|
*
|
|
22
22
|
* @param markdown - The rendered page markdown.
|
package/dist/index.mjs
CHANGED
|
@@ -6,10 +6,10 @@ import { ParameterType, RendererEvent } from "typedoc";
|
|
|
6
6
|
* `@pantoken/typedoc-plugin-live-example` — embed a live HTML preview beneath each `@example` on a CSS
|
|
7
7
|
* reference page.
|
|
8
8
|
*
|
|
9
|
-
* `@cssdoc/markdown` renders an `@example` as a plain `
|
|
9
|
+
* `@cssdoc/markdown` renders an `@example` as a plain `html` code fence, and stays that way on
|
|
10
10
|
* purpose — a generic renderer can't assume the host page loads the component CSS globally. pantoken's
|
|
11
11
|
* docs DO load `@pantoken/components` globally, so each example can render live under its source. This
|
|
12
|
-
* plugin post-processes the emitted markdown: after every `
|
|
12
|
+
* plugin post-processes the emitted markdown: after every `html` fence it appends a
|
|
13
13
|
* `<div class="css-example">` holding the same markup, which the docs theme styles as one joined
|
|
14
14
|
* "source + preview" card. Overlay examples (`<dialog>`, `[popover]`) are skipped — they're hidden until
|
|
15
15
|
* opened, so their `## Demo` iframe drives the preview instead.
|
|
@@ -21,7 +21,7 @@ import { ParameterType, RendererEvent } from "typedoc";
|
|
|
21
21
|
* @module
|
|
22
22
|
* @beta
|
|
23
23
|
*/
|
|
24
|
-
/** A fenced `
|
|
24
|
+
/** A fenced `html` block and its inner markup. */
|
|
25
25
|
const HTML_FENCE = /```html\n([\s\S]*?)\n```/gu;
|
|
26
26
|
/** An example that's hidden until opened (a `<dialog>` or a `[popover]`), so its live preview is skipped. */
|
|
27
27
|
function isOverlay(html) {
|
|
@@ -32,7 +32,7 @@ function defaultWrap(html) {
|
|
|
32
32
|
return `<div class="css-example">\n${html}\n</div>`;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
|
-
* Append a live preview after each `
|
|
35
|
+
* Append a live preview after each `html` fence in `markdown`, echoing the fence's markup through
|
|
36
36
|
* {@link LiveExampleOptions.wrap} so it renders beneath the source. Overlay examples are left source-only.
|
|
37
37
|
*
|
|
38
38
|
* @param markdown - The rendered page markdown.
|
package/package.json
CHANGED
|
@@ -1,33 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pantoken/typedoc-plugin-live-example",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "TypeDoc plugin: embed a live HTML preview beneath each @example on a CSS reference page.",
|
|
5
|
+
"homepage": "https://pantoken.iywahl.com",
|
|
6
|
+
"bugs": "https://github.com/thedannywahl/pantoken/issues",
|
|
5
7
|
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/thedannywahl/pantoken.git",
|
|
11
|
+
"directory": "plugins/typedoc/live-example"
|
|
12
|
+
},
|
|
6
13
|
"files": [
|
|
7
14
|
"dist"
|
|
8
15
|
],
|
|
9
16
|
"type": "module",
|
|
17
|
+
"sideEffects": false,
|
|
10
18
|
"exports": {
|
|
11
19
|
".": "./dist/index.mjs",
|
|
12
20
|
"./package.json": "./package.json"
|
|
13
21
|
},
|
|
14
22
|
"publishConfig": {
|
|
15
|
-
"access": "public"
|
|
23
|
+
"access": "public",
|
|
24
|
+
"provenance": true
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"dev": "vp pack --watch",
|
|
28
|
+
"test": "vp test",
|
|
29
|
+
"check": "vp check"
|
|
16
30
|
},
|
|
17
31
|
"devDependencies": {
|
|
18
|
-
"@types/node": "
|
|
19
|
-
"typedoc": "
|
|
20
|
-
"typescript": "
|
|
21
|
-
"vite": "
|
|
22
|
-
"vite-plus": "
|
|
32
|
+
"@types/node": "catalog:",
|
|
33
|
+
"typedoc": "catalog:",
|
|
34
|
+
"typescript": "catalog:",
|
|
35
|
+
"vite": "catalog:",
|
|
36
|
+
"vite-plus": "catalog:"
|
|
23
37
|
},
|
|
24
38
|
"peerDependencies": {
|
|
25
39
|
"typedoc": ">=0.28"
|
|
26
40
|
},
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"dev": "vp pack --watch",
|
|
30
|
-
"test": "vp test",
|
|
31
|
-
"check": "vp check"
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=22.18.0"
|
|
32
43
|
}
|
|
33
|
-
}
|
|
44
|
+
}
|