starlight-cannoli-plugins 1.2.3 → 1.2.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/README.md
CHANGED
|
@@ -57,7 +57,7 @@ Automatically compiles fenced `tex compile` and `latex compile` code blocks to S
|
|
|
57
57
|
- Compiles LaTeX/TikZ code blocks to SVG automatically
|
|
58
58
|
- Caches compiled SVGs by content hash (no recompilation if unchanged)
|
|
59
59
|
- Comprehensive error reporting with line numbers and formatted LaTeX source
|
|
60
|
-
- Supports custom preamble via
|
|
60
|
+
- Supports custom preamble via `% ===` separator in code blocks
|
|
61
61
|
- Works seamlessly with Starlight's content pipeline
|
|
62
62
|
- Requires `svgOutputDir` configuration (no defaults)
|
|
63
63
|
|
|
@@ -113,13 +113,13 @@ Use either ` ```tex compile ` or ` ```latex compile ` — both work identically:
|
|
|
113
113
|
|
|
114
114
|
**Custom Preamble:**
|
|
115
115
|
|
|
116
|
-
Use
|
|
116
|
+
Use `% ===` to separate custom preamble from diagram content:
|
|
117
117
|
|
|
118
118
|
````markdown
|
|
119
119
|
```tex compile
|
|
120
120
|
\usepackage{tikz-3dplot}
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
% ===
|
|
123
123
|
|
|
124
124
|
\begin{tikzpicture}
|
|
125
125
|
% diagram code here
|
|
@@ -129,7 +129,7 @@ Use `%---` to separate custom preamble from diagram content:
|
|
|
129
129
|
|
|
130
130
|
**Complete Document Control:**
|
|
131
131
|
|
|
132
|
-
If your code block contains both `\documentclass` and `\begin{document}`, the plugin treats it as a complete, self-contained LaTeX document and uses it as-is without checking for a
|
|
132
|
+
If your code block contains both `\documentclass` and `\begin{document}`, the plugin treats it as a complete, self-contained LaTeX document and uses it as-is without checking for a `% ===` separator for a preamble:
|
|
133
133
|
|
|
134
134
|
````markdown
|
|
135
135
|
```tex compile
|
|
@@ -173,7 +173,7 @@ function buildLatexSource(latexCode) {
|
|
|
173
173
|
if (latexCode.includes("\\documentclass") && latexCode.includes("\\begin{document}")) {
|
|
174
174
|
return latexCode.trim();
|
|
175
175
|
}
|
|
176
|
-
const separatorRegex = /%[ \t]
|
|
176
|
+
const separatorRegex = /%[ \t]*===/;
|
|
177
177
|
const parts = latexCode.split(separatorRegex);
|
|
178
178
|
let preamble = "";
|
|
179
179
|
let content = latexCode.trim();
|
package/dist/index.js
CHANGED
package/package.json
CHANGED