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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  parseFrontmatter
3
- } from "./chunk-NCXV367P.js";
3
+ } from "./chunk-WFN7OFMJ.js";
4
4
 
5
5
  // src/plugins/starlight-index-only-sidebar/index.ts
6
6
  import { join as join2 } from "path";
@@ -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 regex = new RegExp(`\\b${escapeRegex(term)}\\b`, "g");
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({
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  parseFrontmatter
3
- } from "./chunk-NCXV367P.js";
3
+ } from "./chunk-WFN7OFMJ.js";
4
4
 
5
5
  // src/plugins/astro-sync-docs-to-public/index.ts
6
6
  import { fileURLToPath } from "url";
@@ -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-TRGFYY3Y.js";
3
+ } from "./chunk-O2TZASB7.js";
4
4
  import {
5
5
  starlightIndexOnlySidebar
6
- } from "./chunk-3GUF4GRX.js";
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-OLF3SRCP.js";
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-K65RRBFX.js";
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-NCXV367P.js";
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
  compileLatexToSvg,
3
3
  remarkLatexCompile
4
- } from "../chunk-OLF3SRCP.js";
4
+ } from "../chunk-57RXO5LG.js";
5
+ import "../chunk-C2VXRQOK.js";
5
6
  import "../chunk-4VNS5WPM.js";
6
7
  export {
7
8
  compileLatexToSvg,
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  syncDocsToPublic
3
- } from "../chunk-K65RRBFX.js";
4
- import "../chunk-NCXV367P.js";
3
+ } from "../chunk-QPHWDN2I.js";
4
+ import "../chunk-WFN7OFMJ.js";
5
+ import "../chunk-C2VXRQOK.js";
5
6
  import "../chunk-4VNS5WPM.js";
6
7
  export {
7
8
  syncDocsToPublic
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  expressiveCodeEmphasis
3
- } from "../chunk-TRGFYY3Y.js";
3
+ } from "../chunk-O2TZASB7.js";
4
4
  import "../chunk-4VNS5WPM.js";
5
5
  export {
6
6
  expressiveCodeEmphasis
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  starlightIndexOnlySidebar
3
- } from "../chunk-3GUF4GRX.js";
4
- import "../chunk-NCXV367P.js";
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "starlight-cannoli-plugins",
3
3
  "type": "module",
4
- "version": "2.12.1",
4
+ "version": "2.13.1",
5
5
  "description": "Starlight plugins for automatic sidebar generation and link validation",
6
6
  "license": "ISC",
7
7
  "main": "./dist/index.js",