starlight-pele 0.0.0-stage → 0.1.0

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 torben haack
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,37 @@
1
- # Temporary Holding Version
1
+ # starlight-pele
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Starlight plugin that renders Mermaid fences to themeable SVG with [Pele](https://pele.run).
4
+
5
+ It adds the Astro integration, maps Pele's colors to Starlight's light and dark theme, and leaves no client JavaScript unless zoom is enabled.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ npm install starlight-pele
11
+ ```
12
+
13
+ ## Setup
14
+
15
+ ```js
16
+ // astro.config.mjs
17
+ import { defineConfig } from 'astro/config';
18
+ import starlight from '@astrojs/starlight';
19
+ import { starlightPele } from 'starlight-pele';
20
+
21
+ export default defineConfig({
22
+ integrations: [starlight({ title: 'Docs', plugins: [starlightPele()] })],
23
+ });
24
+ ```
25
+
26
+ Then use a normal Mermaid fence:
27
+
28
+ ````md
29
+ ```mermaid
30
+ flowchart LR
31
+ A[Markdown] --> B[Static SVG]
32
+ ```
33
+ ````
34
+
35
+ Add `zoom` to a fence for pan and zoom, or pass `starlightPele({ zoom: true })` to enable it everywhere.
36
+
37
+ Full docs: https://t128n.github.io/pele-x/
@@ -0,0 +1,4 @@
1
+ import { AstroPeleOptions } from "astro-pele";
2
+ import { StarlightPlugin } from "@astrojs/starlight/types";
3
+ export interface StarlightPeleOptions extends AstroPeleOptions {}
4
+ export declare function starlightPele(options?: StarlightPeleOptions): StarlightPlugin;
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ import { pele } from "astro-pele";
2
+ // src/index.ts
3
+ const theme = "starlight-pele/theme.css";
4
+ const configured = /* @__PURE__ */ new WeakSet();
5
+ function starlightPele(options = {}) {
6
+ return {
7
+ name: "starlight-pele",
8
+ hooks: { "config:setup": ({ config, addIntegration, updateConfig }) => {
9
+ if (!configured.has(config)) {
10
+ addIntegration(pele(options));
11
+ configured.add(config);
12
+ }
13
+ const customCss = config.customCss ?? [];
14
+ if (!customCss.includes(theme)) updateConfig({ customCss: [...customCss, theme] });
15
+ } }
16
+ };
17
+ }
18
+ export { starlightPele };
package/package.json CHANGED
@@ -1,6 +1,57 @@
1
1
  {
2
- "name": "starlight-pele",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
2
+ "name": "starlight-pele",
3
+ "version": "0.1.0",
4
+ "description": "Starlight plugin that renders Mermaid fences to themeable SVG with Pele.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "keywords": [
8
+ "starlight",
9
+ "astro",
10
+ "mermaid",
11
+ "pele",
12
+ "svg",
13
+ "diagrams",
14
+ "documentation"
15
+ ],
16
+ "homepage": "https://t128n.github.io/pele-x/",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/t128n/pele-x.git",
20
+ "directory": "packages/starlight"
21
+ },
22
+ "bugs": {
23
+ "url": "https://github.com/t128n/pele-x/issues"
24
+ },
25
+ "files": [
26
+ "dist",
27
+ "theme.css",
28
+ "README.md",
29
+ "LICENSE"
30
+ ],
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "engines": {
35
+ "node": ">=22.23.4"
36
+ },
37
+ "main": "./dist/index.js",
38
+ "types": "./dist/index.d.ts",
39
+ "exports": {
40
+ ".": {
41
+ "types": "./dist/index.d.ts",
42
+ "import": "./dist/index.js"
43
+ },
44
+ "./theme.css": "./theme.css"
45
+ },
46
+ "scripts": {
47
+ "build": "tsdown",
48
+ "typecheck": "tsc --noEmit"
49
+ },
50
+ "dependencies": {
51
+ "astro-pele": "workspace:*"
52
+ },
53
+ "peerDependencies": {
54
+ "@astrojs/starlight": "^0.42.0",
55
+ "astro": "^7.2.0"
56
+ }
57
+ }
package/theme.css ADDED
@@ -0,0 +1,38 @@
1
+ :root {
2
+ --pele-bg: var(--sl-color-bg);
3
+ --pele-fg: var(--sl-color-text);
4
+ --pele-muted: var(--sl-color-gray-3);
5
+ --pele-line: var(--sl-color-gray-5);
6
+ --pele-surface: var(--sl-color-bg-sidebar);
7
+ --pele-surface-alt: var(--sl-color-bg-inline-code);
8
+ --pele-border: var(--sl-color-hairline);
9
+ --pele-accent: var(--sl-color-accent);
10
+ }
11
+
12
+ .pele-diagram {
13
+ margin: 1.5rem 0;
14
+ overflow-x: auto;
15
+ }
16
+
17
+ .pele-diagram svg {
18
+ display: block;
19
+ max-width: 100%;
20
+ height: auto;
21
+ margin-inline: auto;
22
+ }
23
+
24
+ .pele-diagram figcaption {
25
+ margin-top: 0.75rem;
26
+ color: var(--pele-muted);
27
+ font-size: 0.875rem;
28
+ text-align: center;
29
+ }
30
+
31
+ .pele-error {
32
+ padding: 1rem;
33
+ border: 1px solid var(--pele-border);
34
+ border-radius: var(--pele-radius, 4px);
35
+ background: var(--pele-surface);
36
+ color: var(--pele-fg);
37
+ white-space: pre-wrap;
38
+ }