svelte-preprocess-org 0.2.1 → 0.2.2
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/index.js +1 -1
- package/dist/lisp/ox-svelte/index.d.ts +2 -2
- package/dist/lisp/ox-svelte/pnpm-lock.yaml +112 -50
- package/package.json +1 -1
- package/src/emacs.ts +9 -3
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{execSync as n}from"node:child_process";import{join as r}from"node:path";class
|
|
1
|
+
import{execSync as n}from"node:child_process";import{join as r}from"node:path";class e{name;constructor(n){this.name=n}}class t{sexp;constructor(n){this.sexp=n}}function o(n){return n instanceof Object&&"car"in n&&"cdr"in n}function c(n){return null===n}function i(n,r){return{car:n,cdr:r}}function a(...n){if(0===n.length)return null;const[r,...e]=n;return i(r,a(...e))}function s(n){if(o(n))return`(${u(n)})`;if(c(n))return"nil";if("string"==typeof n)return`"${n}"`;if(function(n){return"number"==typeof n}(n))return n.toString();if(function(n){return"boolean"==typeof n}(n))return n?"t":"nil";if(n instanceof e)return n.name;if(n instanceof t)return`'${s(n.sexp)}`;throw new TypeError("Unknown type of S-expression: "+typeof n)}function u(n){let r="";if(o(n.car)?r+=`(${u(n.car)})`:r+=s(n.car),o(n.cdr))r+=` ${u(n.cdr)}`;else{if(c(n.cdr))return r;r+=` . ${s(n.cdr)}`}return r}function f(o){const{extensions:c=[".org"],...u}=o||{};return{markup({content:o,filename:f}){if(f&&!c.some((n=>f.endsWith(n))))return{code:o};const l=function(o,c){const{latexEnvironmentFormat:u,latexFragmentFormat:f,srcBlockFormat:l,imports:m}=c||{};let p=`/usr/bin/env emacs --script ${r(import.meta.dirname,"lisp","convert.el")}`;u&&(p+=` --latex-environment-format '${u.replaceAll("'","'\\''")}'`),f&&(p+=` --latex-fragment-format ${f.replaceAll("'","'\\''")}`),l&&(p+=` --src-block-format ${l.replaceAll("'","'\\''")}`),m&&(p+=` --preface '${s(a(new e("setq"),new e("org-svelte-component-import-alist"),new t(a(...Object.entries(m).map((([n,r])=>i(n,r))))))).replaceAll("'","'\\''")}'`);return n(p,{input:o}).toString()}(o,u);return{code:l}}}}export{f as default,f as orgPreprocess};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
lockfileVersion:
|
|
1
|
+
lockfileVersion: "6.0"
|
|
2
2
|
|
|
3
3
|
settings:
|
|
4
4
|
autoInstallPeers: true
|
|
@@ -10,138 +10,200 @@ devDependencies:
|
|
|
10
10
|
version: 4.2.12
|
|
11
11
|
|
|
12
12
|
packages:
|
|
13
|
-
|
|
14
13
|
/@ampproject/remapping@2.2.1:
|
|
15
|
-
resolution:
|
|
16
|
-
|
|
14
|
+
resolution:
|
|
15
|
+
{
|
|
16
|
+
integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==,
|
|
17
|
+
}
|
|
18
|
+
engines: { node: ">=6.0.0" }
|
|
17
19
|
dependencies:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
"@jridgewell/gen-mapping": 0.3.4
|
|
21
|
+
"@jridgewell/trace-mapping": 0.3.23
|
|
20
22
|
dev: true
|
|
21
23
|
|
|
22
24
|
/@jridgewell/gen-mapping@0.3.4:
|
|
23
|
-
resolution:
|
|
24
|
-
|
|
25
|
+
resolution:
|
|
26
|
+
{
|
|
27
|
+
integrity: sha512-Oud2QPM5dHviZNn4y/WhhYKSXksv+1xLEIsNrAbGcFzUN3ubqWRFT5gwPchNc5NuzILOU4tPBDTZ4VwhL8Y7cw==,
|
|
28
|
+
}
|
|
29
|
+
engines: { node: ">=6.0.0" }
|
|
25
30
|
dependencies:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
"@jridgewell/set-array": 1.1.2
|
|
32
|
+
"@jridgewell/sourcemap-codec": 1.4.15
|
|
33
|
+
"@jridgewell/trace-mapping": 0.3.23
|
|
29
34
|
dev: true
|
|
30
35
|
|
|
31
36
|
/@jridgewell/resolve-uri@3.1.2:
|
|
32
|
-
resolution:
|
|
33
|
-
|
|
37
|
+
resolution:
|
|
38
|
+
{
|
|
39
|
+
integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==,
|
|
40
|
+
}
|
|
41
|
+
engines: { node: ">=6.0.0" }
|
|
34
42
|
dev: true
|
|
35
43
|
|
|
36
44
|
/@jridgewell/set-array@1.1.2:
|
|
37
|
-
resolution:
|
|
38
|
-
|
|
45
|
+
resolution:
|
|
46
|
+
{
|
|
47
|
+
integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==,
|
|
48
|
+
}
|
|
49
|
+
engines: { node: ">=6.0.0" }
|
|
39
50
|
dev: true
|
|
40
51
|
|
|
41
52
|
/@jridgewell/sourcemap-codec@1.4.15:
|
|
42
|
-
resolution:
|
|
53
|
+
resolution:
|
|
54
|
+
{
|
|
55
|
+
integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==,
|
|
56
|
+
}
|
|
43
57
|
dev: true
|
|
44
58
|
|
|
45
59
|
/@jridgewell/trace-mapping@0.3.23:
|
|
46
|
-
resolution:
|
|
60
|
+
resolution:
|
|
61
|
+
{
|
|
62
|
+
integrity: sha512-9/4foRoUKp8s96tSkh8DlAAc5A0Ty8vLXld+l9gjKKY6ckwI8G15f0hskGmuLZu78ZlGa1vtsfOa+lnB4vG6Jg==,
|
|
63
|
+
}
|
|
47
64
|
dependencies:
|
|
48
|
-
|
|
49
|
-
|
|
65
|
+
"@jridgewell/resolve-uri": 3.1.2
|
|
66
|
+
"@jridgewell/sourcemap-codec": 1.4.15
|
|
50
67
|
dev: true
|
|
51
68
|
|
|
52
69
|
/@types/estree@1.0.5:
|
|
53
|
-
resolution:
|
|
70
|
+
resolution:
|
|
71
|
+
{
|
|
72
|
+
integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==,
|
|
73
|
+
}
|
|
54
74
|
dev: true
|
|
55
75
|
|
|
56
76
|
/acorn@8.11.3:
|
|
57
|
-
resolution:
|
|
58
|
-
|
|
77
|
+
resolution:
|
|
78
|
+
{
|
|
79
|
+
integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==,
|
|
80
|
+
}
|
|
81
|
+
engines: { node: ">=0.4.0" }
|
|
59
82
|
hasBin: true
|
|
60
83
|
dev: true
|
|
61
84
|
|
|
62
85
|
/aria-query@5.3.0:
|
|
63
|
-
resolution:
|
|
86
|
+
resolution:
|
|
87
|
+
{
|
|
88
|
+
integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==,
|
|
89
|
+
}
|
|
64
90
|
dependencies:
|
|
65
91
|
dequal: 2.0.3
|
|
66
92
|
dev: true
|
|
67
93
|
|
|
68
94
|
/axobject-query@4.0.0:
|
|
69
|
-
resolution:
|
|
95
|
+
resolution:
|
|
96
|
+
{
|
|
97
|
+
integrity: sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==,
|
|
98
|
+
}
|
|
70
99
|
dependencies:
|
|
71
100
|
dequal: 2.0.3
|
|
72
101
|
dev: true
|
|
73
102
|
|
|
74
103
|
/code-red@1.0.4:
|
|
75
|
-
resolution:
|
|
104
|
+
resolution:
|
|
105
|
+
{
|
|
106
|
+
integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==,
|
|
107
|
+
}
|
|
76
108
|
dependencies:
|
|
77
|
-
|
|
78
|
-
|
|
109
|
+
"@jridgewell/sourcemap-codec": 1.4.15
|
|
110
|
+
"@types/estree": 1.0.5
|
|
79
111
|
acorn: 8.11.3
|
|
80
112
|
estree-walker: 3.0.3
|
|
81
113
|
periscopic: 3.1.0
|
|
82
114
|
dev: true
|
|
83
115
|
|
|
84
116
|
/css-tree@2.3.1:
|
|
85
|
-
resolution:
|
|
86
|
-
|
|
117
|
+
resolution:
|
|
118
|
+
{
|
|
119
|
+
integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==,
|
|
120
|
+
}
|
|
121
|
+
engines: { node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0 }
|
|
87
122
|
dependencies:
|
|
88
123
|
mdn-data: 2.0.30
|
|
89
124
|
source-map-js: 1.0.2
|
|
90
125
|
dev: true
|
|
91
126
|
|
|
92
127
|
/dequal@2.0.3:
|
|
93
|
-
resolution:
|
|
94
|
-
|
|
128
|
+
resolution:
|
|
129
|
+
{
|
|
130
|
+
integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==,
|
|
131
|
+
}
|
|
132
|
+
engines: { node: ">=6" }
|
|
95
133
|
dev: true
|
|
96
134
|
|
|
97
135
|
/estree-walker@3.0.3:
|
|
98
|
-
resolution:
|
|
136
|
+
resolution:
|
|
137
|
+
{
|
|
138
|
+
integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==,
|
|
139
|
+
}
|
|
99
140
|
dependencies:
|
|
100
|
-
|
|
141
|
+
"@types/estree": 1.0.5
|
|
101
142
|
dev: true
|
|
102
143
|
|
|
103
144
|
/is-reference@3.0.2:
|
|
104
|
-
resolution:
|
|
145
|
+
resolution:
|
|
146
|
+
{
|
|
147
|
+
integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==,
|
|
148
|
+
}
|
|
105
149
|
dependencies:
|
|
106
|
-
|
|
150
|
+
"@types/estree": 1.0.5
|
|
107
151
|
dev: true
|
|
108
152
|
|
|
109
153
|
/locate-character@3.0.0:
|
|
110
|
-
resolution:
|
|
154
|
+
resolution:
|
|
155
|
+
{
|
|
156
|
+
integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==,
|
|
157
|
+
}
|
|
111
158
|
dev: true
|
|
112
159
|
|
|
113
160
|
/magic-string@0.30.7:
|
|
114
|
-
resolution:
|
|
115
|
-
|
|
161
|
+
resolution:
|
|
162
|
+
{
|
|
163
|
+
integrity: sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==,
|
|
164
|
+
}
|
|
165
|
+
engines: { node: ">=12" }
|
|
116
166
|
dependencies:
|
|
117
|
-
|
|
167
|
+
"@jridgewell/sourcemap-codec": 1.4.15
|
|
118
168
|
dev: true
|
|
119
169
|
|
|
120
170
|
/mdn-data@2.0.30:
|
|
121
|
-
resolution:
|
|
171
|
+
resolution:
|
|
172
|
+
{
|
|
173
|
+
integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==,
|
|
174
|
+
}
|
|
122
175
|
dev: true
|
|
123
176
|
|
|
124
177
|
/periscopic@3.1.0:
|
|
125
|
-
resolution:
|
|
178
|
+
resolution:
|
|
179
|
+
{
|
|
180
|
+
integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==,
|
|
181
|
+
}
|
|
126
182
|
dependencies:
|
|
127
|
-
|
|
183
|
+
"@types/estree": 1.0.5
|
|
128
184
|
estree-walker: 3.0.3
|
|
129
185
|
is-reference: 3.0.2
|
|
130
186
|
dev: true
|
|
131
187
|
|
|
132
188
|
/source-map-js@1.0.2:
|
|
133
|
-
resolution:
|
|
134
|
-
|
|
189
|
+
resolution:
|
|
190
|
+
{
|
|
191
|
+
integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==,
|
|
192
|
+
}
|
|
193
|
+
engines: { node: ">=0.10.0" }
|
|
135
194
|
dev: true
|
|
136
195
|
|
|
137
196
|
/svelte@4.2.12:
|
|
138
|
-
resolution:
|
|
139
|
-
|
|
197
|
+
resolution:
|
|
198
|
+
{
|
|
199
|
+
integrity: sha512-d8+wsh5TfPwqVzbm4/HCXC783/KPHV60NvwitJnyTA5lWn1elhXMNWhXGCJ7PwPa8qFUnyJNIyuIRt2mT0WMug==,
|
|
200
|
+
}
|
|
201
|
+
engines: { node: ">=16" }
|
|
140
202
|
dependencies:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
203
|
+
"@ampproject/remapping": 2.2.1
|
|
204
|
+
"@jridgewell/sourcemap-codec": 1.4.15
|
|
205
|
+
"@jridgewell/trace-mapping": 0.3.23
|
|
206
|
+
"@types/estree": 1.0.5
|
|
145
207
|
acorn: 8.11.3
|
|
146
208
|
aria-query: 5.3.0
|
|
147
209
|
axobject-query: 4.0.0
|
package/package.json
CHANGED
package/src/emacs.ts
CHANGED
|
@@ -24,13 +24,19 @@ export function convert(content: string, options?: OxSvelteOptions): string {
|
|
|
24
24
|
"convert.el",
|
|
25
25
|
)}`;
|
|
26
26
|
if (latexEnvironmentFormat) {
|
|
27
|
-
command += ` --latex-environment-format ${latexEnvironmentFormat
|
|
27
|
+
command += ` --latex-environment-format '${latexEnvironmentFormat.replaceAll(
|
|
28
|
+
"'",
|
|
29
|
+
"'\\''",
|
|
30
|
+
)}'`;
|
|
28
31
|
}
|
|
29
32
|
if (latexFragmentFormat) {
|
|
30
|
-
command += ` --latex-fragment-format ${latexFragmentFormat
|
|
33
|
+
command += ` --latex-fragment-format ${latexFragmentFormat.replaceAll(
|
|
34
|
+
"'",
|
|
35
|
+
"'\\''",
|
|
36
|
+
)}`;
|
|
31
37
|
}
|
|
32
38
|
if (srcBlockFormat) {
|
|
33
|
-
command += ` --src-block-format ${srcBlockFormat}`;
|
|
39
|
+
command += ` --src-block-format ${srcBlockFormat.replaceAll("'", "'\\''")}`;
|
|
34
40
|
}
|
|
35
41
|
if (imports) {
|
|
36
42
|
const sexp = list(
|