starlight-cannoli-plugins 2.5.2 → 2.5.4
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/{chunk-XYVZ5MOQ.js → chunk-2Z7KWWVF.js} +0 -13
- package/dist/{chunk-XVMRLEQM.js → chunk-Z6DVEB7O.js} +4 -6
- package/dist/index.js +2 -2
- package/dist/plugins/astro-latex-compile.js +1 -1
- package/dist/plugins/expressive-code-emphasis.js +1 -1
- package/dist/styles/_expressive-code-emphasis.scss +7 -0
- package/dist/styles/main.scss +1 -0
- package/package.json +1 -1
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
ExpressiveCodeAnnotation
|
|
5
5
|
} from "@expressive-code/core";
|
|
6
6
|
import { h } from "@expressive-code/core/hast";
|
|
7
|
-
var css = String.raw;
|
|
8
7
|
var EmphasisAnnotation = class extends ExpressiveCodeAnnotation {
|
|
9
8
|
render({ nodesToTransform }) {
|
|
10
9
|
return nodesToTransform.map((node) => h("span.fw-supreme", [node]));
|
|
@@ -21,18 +20,6 @@ function parseEmphTerms(meta) {
|
|
|
21
20
|
function expressiveCodeEmphasis() {
|
|
22
21
|
return definePlugin({
|
|
23
22
|
name: "expressiveCodeEmphasis",
|
|
24
|
-
baseStyles: css`
|
|
25
|
-
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@700;800&display=swap");
|
|
26
|
-
|
|
27
|
-
.fw-supreme {
|
|
28
|
-
font-family: "Open Sans", sans-serif;
|
|
29
|
-
font-weight: 800;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
html:not([data-theme="light"]) .fw-supreme > span {
|
|
33
|
-
color: var(--sl-color-white);
|
|
34
|
-
}
|
|
35
|
-
`,
|
|
36
23
|
hooks: {
|
|
37
24
|
preprocessCode: (context) => {
|
|
38
25
|
const terms = parseEmphTerms(context.codeBlock.meta);
|
|
@@ -138,17 +138,15 @@ function formatLatexSourceWithLineNumbers(latexSource, errors) {
|
|
|
138
138
|
const RED = "\x1B[31m";
|
|
139
139
|
const RESET = "\x1B[0m";
|
|
140
140
|
const lines = latexSource.split("\n");
|
|
141
|
-
const
|
|
142
|
-
const lineNumWidth = String(maxLineNum).length;
|
|
141
|
+
const setwidthAmount = "[999]".length;
|
|
143
142
|
const errorLineNumbers = new Set(errors.map((e) => e.line).filter(Boolean));
|
|
144
143
|
const formattedLines = lines.map((line, index) => {
|
|
145
144
|
const lineNum = index + 1;
|
|
146
|
-
const
|
|
147
|
-
const padding = lineNumStr.length < lineNumWidth ? " " : "";
|
|
145
|
+
const lineNumIdentifier = `[${lineNum}]`.padStart(setwidthAmount);
|
|
148
146
|
if (errorLineNumbers.has(lineNum)) {
|
|
149
|
-
return `${
|
|
147
|
+
return `${RED}${lineNumIdentifier}:${RESET} ${line}`;
|
|
150
148
|
}
|
|
151
|
-
return `${
|
|
149
|
+
return `${lineNumIdentifier}: ${line}`;
|
|
152
150
|
}).join("\n");
|
|
153
151
|
return formattedLines;
|
|
154
152
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
expressiveCodeEmphasis
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2Z7KWWVF.js";
|
|
4
4
|
import {
|
|
5
5
|
starlightIndexOnlySidebar
|
|
6
6
|
} from "./chunk-N2I2GJW3.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-3UMY7T6G.js";
|
|
10
10
|
import {
|
|
11
11
|
remarkLatexCompile
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-Z6DVEB7O.js";
|
|
13
13
|
import {
|
|
14
14
|
astroNormalizePaths
|
|
15
15
|
} from "./chunk-TLOFSB33.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
@import url("https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&display=swap");
|
|
2
|
+
|
|
3
|
+
.fw-supreme {
|
|
4
|
+
font-family: "Source Code Pro", ui-monospace, monospace !important;
|
|
5
|
+
font-weight: 900 !important;
|
|
6
|
+
-webkit-text-stroke: 0.1px currentColor;
|
|
7
|
+
}
|
package/dist/styles/main.scss
CHANGED
package/package.json
CHANGED