starlight-cannoli-plugins 2.0.0 → 2.0.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 +1 -1
- package/dist/{chunk-S4YMC25A.js → chunk-IX5UFISR.js} +4 -4
- package/dist/{chunk-3OL3VUEB.js → chunk-JOXQGMUL.js} +1 -1
- package/dist/{chunk-47X5MKFJ.js → chunk-TTQY54Q6.js} +3 -3
- package/dist/cli/cannoli-latex-cleanup.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/dist/plugins/{remark-latex-compile.js → astro-latex-compile.js} +2 -2
- package/dist/plugins/{starlight-sync-docs-to-public.js → astro-sync-docs-to-public.js} +1 -1
- package/package.json +7 -7
- /package/dist/plugins/{remark-latex-compile.d.ts → astro-latex-compile.d.ts} +0 -0
- /package/dist/plugins/{starlight-sync-docs-to-public.d.ts → astro-sync-docs-to-public.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -185,7 +185,7 @@ The underlying remark plugin used by `astroLatexCompile`. Use this directly if y
|
|
|
185
185
|
```ts
|
|
186
186
|
// astro.config.mjs
|
|
187
187
|
import { defineConfig } from "astro/config";
|
|
188
|
-
import { remarkLatexCompile } from "cannoli-starlight-plugins/
|
|
188
|
+
import { remarkLatexCompile } from "cannoli-starlight-plugins/astro-latex-compile";
|
|
189
189
|
|
|
190
190
|
export default defineConfig({
|
|
191
191
|
markdown: {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compileLatexToSvg,
|
|
3
3
|
hashLatexCode
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TTQY54Q6.js";
|
|
5
5
|
|
|
6
|
-
// src/plugins/
|
|
6
|
+
// src/plugins/astro-latex-compile/index.ts
|
|
7
7
|
import { rm } from "fs/promises";
|
|
8
8
|
import { join, resolve } from "path";
|
|
9
9
|
import { visit as visit2, SKIP } from "unist-util-visit";
|
|
10
10
|
|
|
11
|
-
// src/plugins/
|
|
11
|
+
// src/plugins/astro-latex-compile/rehype-converter.ts
|
|
12
12
|
import { visit } from "unist-util-visit";
|
|
13
13
|
function rehypeLatexCompile() {
|
|
14
14
|
return (tree, _file) => {
|
|
@@ -59,7 +59,7 @@ function rehypeLatexCompile() {
|
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
// src/plugins/
|
|
62
|
+
// src/plugins/astro-latex-compile/index.ts
|
|
63
63
|
function extractClassesFromMeta(meta) {
|
|
64
64
|
const classMatch = meta.match(/class="([^"]+)"/);
|
|
65
65
|
if (classMatch?.[1]) {
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
parseFrontmatter
|
|
3
3
|
} from "./chunk-3ATSZG6H.js";
|
|
4
4
|
|
|
5
|
-
// src/plugins/
|
|
5
|
+
// src/plugins/astro-sync-docs-to-public.ts
|
|
6
6
|
import { cp, mkdir, readdir, readFile, writeFile, rm, stat } from "fs/promises";
|
|
7
7
|
import { resolve, relative } from "path";
|
|
8
8
|
import { minimatch } from "minimatch";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/plugins/
|
|
1
|
+
// src/plugins/astro-latex-compile/utils.ts
|
|
2
2
|
import { createHash } from "crypto";
|
|
3
3
|
import { spawn } from "child_process";
|
|
4
4
|
import {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import { join } from "path";
|
|
12
12
|
import { tmpdir } from "os";
|
|
13
13
|
|
|
14
|
-
// src/plugins/
|
|
14
|
+
// src/plugins/astro-latex-compile/error-parser.ts
|
|
15
15
|
function parseLatexError(latexOutput) {
|
|
16
16
|
const lines = latexOutput.split("\n");
|
|
17
17
|
const errors = [];
|
|
@@ -161,7 +161,7 @@ ${formattedSource}
|
|
|
161
161
|
`;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
// src/plugins/
|
|
164
|
+
// src/plugins/astro-latex-compile/utils.ts
|
|
165
165
|
var LATEX_BLOCK_REGEX = /```(?:tex|latex)\s+compile[^\r\n]*\r?\n([\s\S]*?)\r?\n```/g;
|
|
166
166
|
function hashLatexCode(code) {
|
|
167
167
|
const normalized = code.split("\n").map((line) => line.trim()).filter((line) => !line.startsWith("%")).filter(Boolean).join("\n").trim();
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { starlightIndexOnlySidebar } from './plugins/starlight-index-only-sidebar.js';
|
|
2
|
-
export { SyncDocsToPublicOptions, syncDocsToPublic } from './plugins/
|
|
2
|
+
export { SyncDocsToPublicOptions, syncDocsToPublic } from './plugins/astro-sync-docs-to-public.js';
|
|
3
3
|
export { default as rehypeValidateLinks } from './plugins/rehype-validate-links.js';
|
|
4
4
|
export { astroNormalizePaths } from './plugins/astro-normalize-paths.js';
|
|
5
|
-
import { RemarkLatexCompileOptions } from './plugins/
|
|
6
|
-
export { rehypeLatexCompile, default as remarkLatexCompile } from './plugins/
|
|
5
|
+
import { RemarkLatexCompileOptions } from './plugins/astro-latex-compile.js';
|
|
6
|
+
export { rehypeLatexCompile, default as remarkLatexCompile } from './plugins/astro-latex-compile.js';
|
|
7
7
|
import { AstroIntegration } from 'astro';
|
|
8
8
|
import '@astrojs/starlight/types';
|
|
9
9
|
import 'hast';
|
package/dist/index.js
CHANGED
|
@@ -7,18 +7,18 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
rehypeLatexCompile,
|
|
9
9
|
remarkLatexCompile
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IX5UFISR.js";
|
|
11
11
|
import {
|
|
12
12
|
astroNormalizePaths
|
|
13
13
|
} from "./chunk-AZPHBHBE.js";
|
|
14
14
|
import {
|
|
15
15
|
syncDocsToPublic
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-JOXQGMUL.js";
|
|
17
17
|
import "./chunk-3ATSZG6H.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-TTQY54Q6.js";
|
|
19
19
|
import "./chunk-QGM4M3NI.js";
|
|
20
20
|
|
|
21
|
-
// src/plugins/
|
|
21
|
+
// src/plugins/astro-latex-compile/astro-integration.ts
|
|
22
22
|
import fs from "fs";
|
|
23
23
|
import { readdir, rm } from "fs/promises";
|
|
24
24
|
import { join, resolve } from "path";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rehypeLatexCompile,
|
|
3
3
|
remarkLatexCompile
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-IX5UFISR.js";
|
|
5
5
|
import {
|
|
6
6
|
compileLatexToSvg
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-TTQY54Q6.js";
|
|
8
8
|
import "../chunk-QGM4M3NI.js";
|
|
9
9
|
export {
|
|
10
10
|
compileLatexToSvg,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "starlight-cannoli-plugins",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.1",
|
|
5
5
|
"description": "Starlight plugins for automatic sidebar generation and link validation",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"import": "./dist/plugins/astro-normalize-paths.js",
|
|
27
27
|
"types": "./dist/plugins/astro-normalize-paths.d.ts"
|
|
28
28
|
},
|
|
29
|
-
"./
|
|
30
|
-
"import": "./dist/plugins/
|
|
31
|
-
"types": "./dist/plugins/
|
|
29
|
+
"./astro-latex-compile": {
|
|
30
|
+
"import": "./dist/plugins/astro-latex-compile.js",
|
|
31
|
+
"types": "./dist/plugins/astro-latex-compile.d.ts"
|
|
32
32
|
},
|
|
33
|
-
"./
|
|
34
|
-
"import": "./dist/plugins/
|
|
35
|
-
"types": "./dist/plugins/
|
|
33
|
+
"./astro-sync-docs-to-public": {
|
|
34
|
+
"import": "./dist/plugins/astro-sync-docs-to-public.js",
|
|
35
|
+
"types": "./dist/plugins/astro-sync-docs-to-public.d.ts"
|
|
36
36
|
},
|
|
37
37
|
"./styles": "./dist/styles/",
|
|
38
38
|
"./styles/*": "./dist/styles/*"
|
|
File without changes
|
|
File without changes
|