starlight-cannoli-plugins 2.12.1 → 2.13.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 +55 -31
- package/dist/{chunk-OLF3SRCP.js → chunk-57RXO5LG.js} +194 -31
- package/dist/{chunk-NCXV367P.js → chunk-C2VXRQOK.js} +10823 -10844
- package/dist/{chunk-3GUF4GRX.js → chunk-JFHWCFHF.js} +1 -1
- package/dist/{chunk-TRGFYY3Y.js → chunk-O2TZASB7.js} +6 -1
- package/dist/{chunk-K65RRBFX.js → chunk-QPHWDN2I.js} +1 -1
- package/dist/chunk-WFN7OFMJ.js +28 -0
- package/dist/index.js +8 -6
- package/dist/plugins/astro-latex-compile.d.ts +1 -1
- package/dist/plugins/astro-latex-compile.js +2 -1
- package/dist/plugins/astro-sync-docs-to-public.js +3 -2
- package/dist/plugins/expressive-code-emphasis.js +1 -1
- package/dist/plugins/starlight-index-only-sidebar.js +3 -2
- package/dist/styles/_starlight.scss +15 -0
- package/package.json +1 -1
|
@@ -22,7 +22,12 @@ function expressiveCodeEmphasis() {
|
|
|
22
22
|
if (terms.length === 0) return;
|
|
23
23
|
for (const line of context.codeBlock.getLines()) {
|
|
24
24
|
for (const term of terms) {
|
|
25
|
-
const
|
|
25
|
+
const left = /\w/.test(term[0]) ? "\\b" : "(?<!\\S)";
|
|
26
|
+
const right = /\w/.test(term[term.length - 1]) ? "\\b" : "(?!\\S)";
|
|
27
|
+
const regex = new RegExp(
|
|
28
|
+
`${left}${escapeRegex(term)}${right}`,
|
|
29
|
+
"g"
|
|
30
|
+
);
|
|
26
31
|
for (const match of line.text.matchAll(regex)) {
|
|
27
32
|
line.addAnnotation(
|
|
28
33
|
new EmphasisAnnotation({
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
parseFrontmatter
|
|
3
|
+
} from "./chunk-C2VXRQOK.js";
|
|
4
|
+
|
|
5
|
+
// src/plugins/utils/workspace-utils.ts
|
|
6
|
+
import * as fs from "fs";
|
|
7
|
+
function parseFrontmatter2(filePath) {
|
|
8
|
+
let content;
|
|
9
|
+
try {
|
|
10
|
+
content = fs.readFileSync(filePath, "utf-8");
|
|
11
|
+
} catch {
|
|
12
|
+
return {};
|
|
13
|
+
}
|
|
14
|
+
try {
|
|
15
|
+
const { frontmatter } = parseFrontmatter(content);
|
|
16
|
+
return frontmatter;
|
|
17
|
+
} catch (err) {
|
|
18
|
+
console.warn(
|
|
19
|
+
`[parseFrontmatter] Failed to parse frontmatter in ${filePath}:`,
|
|
20
|
+
err
|
|
21
|
+
);
|
|
22
|
+
return {};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
parseFrontmatter2 as parseFrontmatter
|
|
28
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
2
|
expressiveCodeEmphasis
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-O2TZASB7.js";
|
|
4
4
|
import {
|
|
5
5
|
starlightIndexOnlySidebar
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JFHWCFHF.js";
|
|
7
7
|
import {
|
|
8
8
|
rehypeValidateLinks
|
|
9
9
|
} from "./chunk-3UMY7T6G.js";
|
|
10
10
|
import {
|
|
11
11
|
remarkLatexCompile
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-57RXO5LG.js";
|
|
13
13
|
import {
|
|
14
14
|
astroNormalizePaths
|
|
15
15
|
} from "./chunk-TLOFSB33.js";
|
|
16
16
|
import "./chunk-LJWSZSPB.js";
|
|
17
17
|
import {
|
|
18
18
|
syncDocsToPublic
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-QPHWDN2I.js";
|
|
20
|
+
import {
|
|
21
|
+
parseFrontmatter
|
|
22
|
+
} from "./chunk-WFN7OFMJ.js";
|
|
20
23
|
import {
|
|
21
|
-
parseFrontmatter,
|
|
22
24
|
remarkParse,
|
|
23
25
|
unified
|
|
24
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-C2VXRQOK.js";
|
|
25
27
|
import {
|
|
26
28
|
starlightDomPatches
|
|
27
29
|
} from "./chunk-PPNIMJPX.js";
|
|
@@ -14,7 +14,7 @@ interface CompilationResult {
|
|
|
14
14
|
* @returns Result object with hash, svgPath, and whether compilation occurred
|
|
15
15
|
* @throws Error if compilation fails
|
|
16
16
|
*/
|
|
17
|
-
declare function compileLatexToSvg(latexCode: string, svgOutputDir: string, texInputDirs?: string[]): Promise<CompilationResult>;
|
|
17
|
+
declare function compileLatexToSvg(latexCode: string, svgOutputDir: string, texInputDirs?: string[], inputsSalt?: string): Promise<CompilationResult>;
|
|
18
18
|
|
|
19
19
|
interface RemarkLatexCompileOptions {
|
|
20
20
|
/**
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
starlightIndexOnlySidebar
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-JFHWCFHF.js";
|
|
4
|
+
import "../chunk-WFN7OFMJ.js";
|
|
5
|
+
import "../chunk-C2VXRQOK.js";
|
|
5
6
|
import "../chunk-4VNS5WPM.js";
|
|
6
7
|
export {
|
|
7
8
|
starlightIndexOnlySidebar
|
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
$DARK_MODE_ROTATE: 178deg;
|
|
4
4
|
|
|
5
|
+
/********** Custom Error Colors **********/
|
|
6
|
+
// Starlight's --sl-color-red-* sit at hsl(349°) which reads as pink/magenta.
|
|
7
|
+
// These replacements use true red (0°) for a more conventional error appearance.
|
|
8
|
+
:root {
|
|
9
|
+
--cannoli-error-low: hsl(0, 70%, 94%);
|
|
10
|
+
--cannoli-error: hsl(0, 72%, 42%);
|
|
11
|
+
--cannoli-error-high: hsl(0, 72%, 28%);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
[data-theme="dark"] {
|
|
15
|
+
--cannoli-error-low: hsl(0, 55%, 16%);
|
|
16
|
+
--cannoli-error: hsl(0, 75%, 60%);
|
|
17
|
+
--cannoli-error-high: hsl(0, 80%, 82%);
|
|
18
|
+
}
|
|
19
|
+
|
|
5
20
|
.sl-container:where(.astro-7nkwcw3z) {
|
|
6
21
|
max-width: 50rem;
|
|
7
22
|
}
|
package/package.json
CHANGED